Create an attribution schema
POST
/api/v1/attribution-schemas
const url = 'https://example.com/api/v1/attribution-schemas';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"workspace_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","properties":[{"name":"example","type":"string","required":true,"default":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/attribution-schemas \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "properties": [ { "name": "example", "type": "string", "required": true, "default": "example" } ] }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
workspace_id
required
ID of the workspace this schema belongs to
string format: uuid
name
required
Name of the attribution schema
string
properties
required
List of property definitions for the attribution schema
Array
One of: discriminator: type
object
name
required
Name of the property
string
type
required
string
required
required
Whether this property is required on attributions
boolean
default
Default value for this property
string
object
name
required
Name of the property
string
type
required
string
required
required
Whether this property is required on attributions
boolean
default
Default value for this property
number
object
name
required
Name of the property
string
type
required
string
required
required
Whether this property is required on attributions
boolean
default
Default value for this property
boolean
Responses
Section titled “ Responses ”Attribution schema created successfully
Media type application/json
object
id
required
ID of the newly created attribution schema
string format: uuid
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Bad request
Media type application/json
object
error_code
required
string
message
required
string
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}Unauthorized
Media type application/json
object
error_code
required
string
message
required
string
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}Internal server error
Media type application/json
object
error_code
required
string
message
required
string
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}