Create a new custom field

Prev Next
Post
/v1/teams/{team_id}/custom-fields

Create a new custom field. Returns HTTP 201 Created with the created resource.

Security
HTTP
Type bearer

API key authentication. Create API keys in the Supermetrics Hub and send them in the Authorization header: Authorization: Bearer <your-api-key>

Header parameters
Sm-App-Id
string

Application identifier

Max length100
Pattern^[A-Za-z0-9_-]+$
ExampleXPLD
Path parameters
team_id
integer (int64) Required

ID of the team

Minimum1
Maximum9223372036854776000
Example936506
Body parameters

Payload for creating a new custom field transformation

{
  "display_name": "Spec Example Field",
  "description": "Temporary transformation for spec examples",
  "field_type": "dim",
  "data_type": "string.text.value",
  "definition": [
    {
      "type": "function",
      "name": "upper_case",
      "arguments": [
        {
          "name": "value",
          "value": {
            "type": "data_source_field",
            "value": "platform"
          }
        }
      ]
    }
  ]
}
Expand All
object

Payload for creating a new custom field (field transformation).

data_source
Array of object

Data sources associated with the custom field. Each entry pairs a data source ID with an optional report type.

Max items100
object

A data source (and optional report type) the custom field applies to.

data_source_id
string

ID of the data source.

Max length100
Pattern^[a-zA-Z0-9_]{2,5}$
ExampleGAWA
report_type
string | null

Report type associated with the data source, if any.

Max length100
Pattern^.+$
Examplesomething
display_name
string Required

User-facing name of the new custom field shown in the UI.

Max length255
Pattern^.+$
ExampleSpec Example Field
description
string

Free-text description of the new custom field.

Max length2048
Pattern^.+$
ExampleTemporary transformation for spec examples
field_type
string Required

Field kind: dim (dimension) or met (metric).

Valid values[ "dim", "met" ]
Exampledim
data_type
string Required

Data type of the custom field (e.g. string.text.value, float.number.value, int.number.value, bool).

Max length100
Pattern^(bool|(float|int|string)(\.[a-z]+)+)$
Examplestring.text.value
definition
Array of object (TransformationStep) Required

Ordered pipeline of transformation steps (function, lookup, or condition) used to compute the custom field.

Max items100
Example[ { "type": "function", "name": "upper_case", "arguments": [ { "name": "value", "value": { "type": "data_source_field", "value": "platform" } } ] } ]

A single step in a custom field's transformation pipeline. The concrete shape is selected by the type discriminator: function, lookup, or condition.

OneOf
FunctionStep
object (FunctionStep)
type
string Required

Discriminator value identifying this step as a function step.

Valid values[ "function" ]
Examplefunction
name
string Required

Name of the function to apply.

Max length255
Pattern^[A-Za-z0-9_-]+$
Exampleupper_case
arguments
Array of object (FunctionArgument) Required

Arguments passed to this function.

Max items100
object

A named argument supplied to a function step.

Example{ "name": "value", "value": { "type": "data_source_field", "value": "platform" } }
name
string Required

Argument name as expected by the function.

Max length255
Pattern^[A-Za-z0-9_-]+$
Examplevalue
value
object (DefinitionValue) Required

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string Required

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
description
string | null

Optional free-text description of the transformation step.

Max length2048
Pattern^[\s\S]+$
Example
LookupStep
object (LookupStep)
type
string Required

Discriminator value identifying this step as a lookup step.

Valid values[ "lookup" ]
Examplelookup
source
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string Required

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
rule
string Required

The matching rule applied when looking up a value (e.g. equals).

Max length100
Pattern^[A-Za-z0-9_-]+$
Exampleequals
map
object Required

Key/value mapping table used by the lookup.

Example{ "1": "2", "a": "b" }
property*
string additionalProperties

Output value produced for the matching key.

Max length2048
default
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string Required

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
description
string | null

Optional free-text description of the transformation step.

Max length2048
Pattern^[\s\S]+$
Example
ConditionStep
object (ConditionStep)
type
string Required

Discriminator value identifying this step as a condition step.

Valid values[ "condition" ]
Examplecondition
default

Value returned when no case matches. May be a plain DefinitionValue or a nested FunctionStep.

OneOf
DefinitionValue
object (DefinitionValue)
type
string Required

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
FunctionStep
object (FunctionStep)
type
string Required

Discriminator value identifying this step as a function step.

Valid values[ "function" ]
Examplefunction
name
string Required

Name of the function to apply.

Max length255
Pattern^[A-Za-z0-9_-]+$
Exampleupper_case
arguments
Array of object (FunctionArgument) Required

Arguments passed to this function.

Max items100
object

A named argument supplied to a function step.

Example{ "name": "value", "value": { "type": "data_source_field", "value": "platform" } }
name
string Required

Argument name as expected by the function.

Max length255
Pattern^[A-Za-z0-9_-]+$
Examplevalue
value
object (DefinitionValue) Required

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string Required

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
description
string | null

Optional free-text description of the transformation step.

Max length2048
Pattern^[\s\S]+$
Example
cases
Array of object (ConditionCase) Required

Condition cases evaluated in order; the first match wins.

Max items100
object

A single case within a condition step: when condition evaluates true, the return value is produced.

Example{ "return": { "type": "output_from_previous" }, "condition": { "type": "rule", "rule": "equals", "source": { "type": "output_from_previous" }, "target": { "type": "static", "value": "1" } } }
return
object (DefinitionValue) Required

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string Required

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
condition
object Required

The rule-based condition evaluated for this case.

type
string Required

Discriminator value identifying the condition kind (always rule).

Valid values[ "rule" ]
Examplerule
rule
string Required

The comparison operator applied between source and target.

Max length100
Pattern^[A-Za-z0-9_-]+$
Exampleequals
source
object (DefinitionValue) Required

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string Required

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
target
object (DefinitionValue) Required

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string Required

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
description
string | null

Optional free-text description of the transformation step.

Max length2048
Pattern^[\s\S]+$
Example
Responses
201

Transformation successfully created

Headers
Location
string
URL of the newly created custom field resource
Max length2048
Access-Control-Allow-Origin
string
Indicates which origins are allowed to access the resource
Max length255
Pattern^.+$
Expand All
object

Success envelope wrapping a single custom field transformation.

Example{ "meta": { "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, "data": { "id": 42, "name": "spec_example_field", "data_source_id": "GAWA", "display_name": "Spec Example Field", "description": "Temporary transformation for spec examples", "field_type": "dim", "data_type": "string.text.value", "modified_time_utc": "2026-04-06T10:59:04Z", "modified_user": { "email": "user@supermetrics.com", "first_name": "John", "last_name": "Doe" }, "definition": { "items": [ { "type": "function", "name": "upper_case", "arguments": [ { "name": "value", "value": { "type": "data_source_field", "value": "platform" } } ], "description": null } ] }, "report_types": [ "Default" ] } }
meta
object (Meta)

Metadata included in every API response.

request_id
string

Unique identifier for the request, for tracking and debugging.

Min length8
Max length64
Pattern^[A-Za-z0-9_-]+$
ExampleBXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN
data
object (TeamTransformationOutput)

A persisted custom field (field transformation) as returned by read operations.

Example{ "id": 42, "name": "spec_example_field", "data_source_id": "GAWA", "display_name": "Spec Example Field Updated", "description": "Updated temporary transformation for spec examples", "field_type": "dim", "data_type": "string.text.value", "modified_time_utc": "2026-04-06T10:59:04Z", "modified_user": { "email": "user@supermetrics.com", "first_name": "John", "last_name": "Doe" }, "definition": { "items": [ { "type": "function", "name": "upper_case", "arguments": [ { "name": "value", "value": { "type": "data_source_field", "value": "platform" } } ], "description": null } ] }, "report_types": [ "Default" ] }
id
integer (int64)

Unique identifier of the custom field.

Minimum1
Maximum9223372036854776000
Example42
name
string

Unique machine name of the field transformation.

Max length255
Pattern^[A-Za-z0-9_-]+$
Examplespec_example_field
data_source_id
string

ID of the data source the transformation belongs to.

Max length100
Pattern^[a-zA-Z0-9_]{2,5}$
ExampleGAWA
display_name
string

User-facing name of the transformation shown in the UI.

Max length255
Pattern^.+$
ExampleSpec Example Field Updated
description
string

Free-text description of the transformation.

Max length2048
Pattern^.*$
ExampleUpdated temporary transformation for spec examples
field_type
string

Field kind: dim (dimension) or met (metric).

Valid values[ "dim", "met" ]
Exampledim
data_type
string

Data type of the transformed field.

Max length100
Pattern^(bool|(float|int|string)(\.[a-z]+)+)$
Examplestring.text.value
modified_time_utc
string (date-time)

Timestamp of the last modification, in UTC. Serialized with a numeric offset (e.g. "+0000") rather than a trailing "Z".

Max length32
Example2026-04-06T10:59:04Z
modified_user
object (TransformationUserOutput)

The user who last modified a custom field transformation.

Example{ "email": "user@supermetrics.com", "first_name": "John", "last_name": "Doe" }
email
string (email)

Email address of the user.

Max length254
Exampleuser@supermetrics.com
first_name
string

First name of the user.

Max length100
Pattern^.+$
ExampleJohn
last_name
string

Last name of the user.

Max length100
Pattern^.+$
ExampleDoe
definition
object

Wrapper holding the ordered transformation steps.

items
Array of object (TransformationStep)

The ordered pipeline of transformation steps.

Max items100
Example[ { "type": "function", "name": "upper_case", "arguments": [ { "name": "value", "value": { "type": "data_source_field", "value": "platform" } } ] } ]

A single step in a custom field's transformation pipeline. The concrete shape is selected by the type discriminator: function, lookup, or condition.

OneOf
FunctionStep
object (FunctionStep)
type
string

Discriminator value identifying this step as a function step.

Valid values[ "function" ]
Examplefunction
name
string

Name of the function to apply.

Max length255
Pattern^[A-Za-z0-9_-]+$
Exampleupper_case
arguments
Array of object (FunctionArgument)

Arguments passed to this function.

Max items100
object

A named argument supplied to a function step.

Example{ "name": "value", "value": { "type": "data_source_field", "value": "platform" } }
name
string

Argument name as expected by the function.

Max length255
Pattern^[A-Za-z0-9_-]+$
Examplevalue
value
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
description
string | null

Optional free-text description of the transformation step.

Max length2048
Pattern^[\s\S]+$
Example
LookupStep
object (LookupStep)
type
string

Discriminator value identifying this step as a lookup step.

Valid values[ "lookup" ]
Examplelookup
source
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
rule
string

The matching rule applied when looking up a value (e.g. equals).

Max length100
Pattern^[A-Za-z0-9_-]+$
Exampleequals
map
object

Key/value mapping table used by the lookup.

Example{ "1": "2", "a": "b" }
property*
string additionalProperties

Output value produced for the matching key.

Max length2048
default
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
description
string | null

Optional free-text description of the transformation step.

Max length2048
Pattern^[\s\S]+$
Example
ConditionStep
object (ConditionStep)
type
string

Discriminator value identifying this step as a condition step.

Valid values[ "condition" ]
Examplecondition
default

Value returned when no case matches. May be a plain DefinitionValue or a nested FunctionStep.

OneOf
DefinitionValue
object (DefinitionValue)
type
string

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
FunctionStep
object (FunctionStep)
type
string

Discriminator value identifying this step as a function step.

Valid values[ "function" ]
Examplefunction
name
string

Name of the function to apply.

Max length255
Pattern^[A-Za-z0-9_-]+$
Exampleupper_case
arguments
Array of object (FunctionArgument)

Arguments passed to this function.

Max items100
object

A named argument supplied to a function step.

Example{ "name": "value", "value": { "type": "data_source_field", "value": "platform" } }
name
string

Argument name as expected by the function.

Max length255
Pattern^[A-Za-z0-9_-]+$
Examplevalue
value
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
description
string | null

Optional free-text description of the transformation step.

Max length2048
Pattern^[\s\S]+$
Example
cases
Array of object (ConditionCase)

Condition cases evaluated in order; the first match wins.

Max items100
object

A single case within a condition step: when condition evaluates true, the return value is produced.

Example{ "return": { "type": "output_from_previous" }, "condition": { "type": "rule", "rule": "equals", "source": { "type": "output_from_previous" }, "target": { "type": "static", "value": "1" } } }
return
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
condition
object

The rule-based condition evaluated for this case.

type
string

Discriminator value identifying the condition kind (always rule).

Valid values[ "rule" ]
Examplerule
rule
string

The comparison operator applied between source and target.

Max length100
Pattern^[A-Za-z0-9_-]+$
Exampleequals
source
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
target
object (DefinitionValue)

A value reference used in transformation steps. Depending on type the value is read from a data-source field, taken from the previous step's output, or supplied as a static literal.

Example{ "type": "data_source_field", "value": "platform" }
type
string

Where the value comes from: data_source_field (a named field on the data source), output_from_previous (the result of the preceding step), or static (a literal value).

Valid values[ "data_source_field", "output_from_previous", "static" ]
Exampledata_source_field
value
string

The value itself: the field name when type is data_source_field, a literal when type is static, and omitted when type is output_from_previous.

Max length255
Exampleplatform
description
string | null

Optional free-text description of the transformation step.

Max length2048
Pattern^[\s\S]+$
Example
report_types
Array of string

Report types associated with the transformation.

Max items100
Example[ "Default" ]
string

A single report type name.

Max length100
Pattern^.+$
400

Bad request - invalid parameters

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN"
  },
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request was invalid."
  }
}
Expand All
object

Standard envelope returned by all error (4xx/5xx) responses.

meta
object (Meta)

Metadata included in every API response.

request_id
string

Unique identifier for the request, for tracking and debugging.

Min length8
Max length64
Pattern^[A-Za-z0-9_-]+$
ExampleBXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN
error
object (Error)

Machine- and human-readable detail for a failed request.

code
string

Stable, screaming-snake-case identifier for the error condition. Clients should branch on this, not on message. Common values include BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT_ERROR, PERMISSION_ERROR, UNPROCESSABLE_ENTITY, UNPROCESSABLE_CONTENT, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, DUPLICATION_FAILED, SERVICE_UNAVAILABLE; domains may define additional codes.

Max length100
Pattern^[A-Z][A-Z0-9_]*$
ExampleBAD_REQUEST
message
string

Short, human-readable summary of the error.

Max length255
Pattern^.+$
ExampleThe request was invalid.
description
string

Optional longer explanation specific to this occurrence.

Max length2048
ExampleThe field 'display_name' must not be empty.
401

Unauthorized

Headers
WWW-Authenticate
string
Bearer token required
Max length255
Pattern^Bearer.*
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN"
  },
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication is required."
  }
}
Expand All
object

Standard envelope returned by all error (4xx/5xx) responses.

meta
object (Meta)

Metadata included in every API response.

request_id
string

Unique identifier for the request, for tracking and debugging.

Min length8
Max length64
Pattern^[A-Za-z0-9_-]+$
ExampleBXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN
error
object (Error)

Machine- and human-readable detail for a failed request.

code
string

Stable, screaming-snake-case identifier for the error condition. Clients should branch on this, not on message. Common values include BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT_ERROR, PERMISSION_ERROR, UNPROCESSABLE_ENTITY, UNPROCESSABLE_CONTENT, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, DUPLICATION_FAILED, SERVICE_UNAVAILABLE; domains may define additional codes.

Max length100
Pattern^[A-Z][A-Z0-9_]*$
ExampleBAD_REQUEST
message
string

Short, human-readable summary of the error.

Max length255
Pattern^.+$
ExampleThe request was invalid.
description
string

Optional longer explanation specific to this occurrence.

Max length2048
ExampleThe field 'display_name' must not be empty.
403

Permission denied

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN"
  },
  "error": {
    "code": "PERMISSION_ERROR",
    "message": "You do not have permission to perform this action."
  }
}
Expand All
object

Standard envelope returned by all error (4xx/5xx) responses.

meta
object (Meta)

Metadata included in every API response.

request_id
string

Unique identifier for the request, for tracking and debugging.

Min length8
Max length64
Pattern^[A-Za-z0-9_-]+$
ExampleBXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN
error
object (Error)

Machine- and human-readable detail for a failed request.

code
string

Stable, screaming-snake-case identifier for the error condition. Clients should branch on this, not on message. Common values include BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT_ERROR, PERMISSION_ERROR, UNPROCESSABLE_ENTITY, UNPROCESSABLE_CONTENT, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, DUPLICATION_FAILED, SERVICE_UNAVAILABLE; domains may define additional codes.

Max length100
Pattern^[A-Z][A-Z0-9_]*$
ExampleBAD_REQUEST
message
string

Short, human-readable summary of the error.

Max length255
Pattern^.+$
ExampleThe request was invalid.
description
string

Optional longer explanation specific to this occurrence.

Max length2048
ExampleThe field 'display_name' must not be empty.
404

Resource not found

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN"
  },
  "error": {
    "code": "NOT_FOUND",
    "message": "The requested resource was not found."
  }
}
Expand All
object

Standard envelope returned by all error (4xx/5xx) responses.

meta
object (Meta)

Metadata included in every API response.

request_id
string

Unique identifier for the request, for tracking and debugging.

Min length8
Max length64
Pattern^[A-Za-z0-9_-]+$
ExampleBXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN
error
object (Error)

Machine- and human-readable detail for a failed request.

code
string

Stable, screaming-snake-case identifier for the error condition. Clients should branch on this, not on message. Common values include BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT_ERROR, PERMISSION_ERROR, UNPROCESSABLE_ENTITY, UNPROCESSABLE_CONTENT, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, DUPLICATION_FAILED, SERVICE_UNAVAILABLE; domains may define additional codes.

Max length100
Pattern^[A-Z][A-Z0-9_]*$
ExampleBAD_REQUEST
message
string

Short, human-readable summary of the error.

Max length255
Pattern^.+$
ExampleThe request was invalid.
description
string

Optional longer explanation specific to this occurrence.

Max length2048
ExampleThe field 'display_name' must not be empty.
429

Too Many Requests

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Retry-After
integer
Seconds until rate limit resets
Minimum1
Maximum86400
Example3600
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN"
  },
  "error": {
    "code": "TOO_MANY_REQUESTS",
    "message": "Rate limit exceeded. Retry later."
  }
}
Expand All
object

Standard envelope returned by all error (4xx/5xx) responses.

meta
object (Meta)

Metadata included in every API response.

request_id
string

Unique identifier for the request, for tracking and debugging.

Min length8
Max length64
Pattern^[A-Za-z0-9_-]+$
ExampleBXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN
error
object (Error)

Machine- and human-readable detail for a failed request.

code
string

Stable, screaming-snake-case identifier for the error condition. Clients should branch on this, not on message. Common values include BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT_ERROR, PERMISSION_ERROR, UNPROCESSABLE_ENTITY, UNPROCESSABLE_CONTENT, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, DUPLICATION_FAILED, SERVICE_UNAVAILABLE; domains may define additional codes.

Max length100
Pattern^[A-Z][A-Z0-9_]*$
ExampleBAD_REQUEST
message
string

Short, human-readable summary of the error.

Max length255
Pattern^.+$
ExampleThe request was invalid.
description
string

Optional longer explanation specific to this occurrence.

Max length2048
ExampleThe field 'display_name' must not be empty.
500

Internal server error

Headers
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "BXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN"
  },
  "error": {
    "code": "INTERNAL_SERVER_ERROR",
    "message": "An unexpected error occurred."
  }
}
Expand All
object

Standard envelope returned by all error (4xx/5xx) responses.

meta
object (Meta)

Metadata included in every API response.

request_id
string

Unique identifier for the request, for tracking and debugging.

Min length8
Max length64
Pattern^[A-Za-z0-9_-]+$
ExampleBXaEFVtjc7TXaJxgZhmFgSUD9edqq_CN
error
object (Error)

Machine- and human-readable detail for a failed request.

code
string

Stable, screaming-snake-case identifier for the error condition. Clients should branch on this, not on message. Common values include BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT_ERROR, PERMISSION_ERROR, UNPROCESSABLE_ENTITY, UNPROCESSABLE_CONTENT, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, DUPLICATION_FAILED, SERVICE_UNAVAILABLE; domains may define additional codes.

Max length100
Pattern^[A-Z][A-Z0-9_]*$
ExampleBAD_REQUEST
message
string

Short, human-readable summary of the error.

Max length255
Pattern^.+$
ExampleThe request was invalid.
description
string

Optional longer explanation specific to this occurrence.

Max length2048
ExampleThe field 'display_name' must not be empty.