younifyd
Menu

Create Attribute Definition

Create Attribute Definition

POST/v2026-04-27/organizations/{organizationId}/attribute-definitions

Use it in a workflow

  1. Add a step and choose the Sanity connector.
  2. Pick the Create Attribute Definition action (under User Attributes).
  3. Fill in the fields below, then reference the result from later steps as {{createAttributeDefinition.response.data}}.

Request

Path parameters

organizationIdstringrequired

Unique identifier of the organization

Request body

Enter the body as JSON in the step's Body field.

keystringrequired

Textual name of the attribute

typestringrequired

Type of the attribute

One ofstringstring-arrayintegerinteger-arraynumbernumber-arrayboolean

json
{
  "key": "year_started",
  "type": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{createAttributeDefinition.response.data.<field>}}.

keystring

Textual name of the attribute

typestring

Type of the attribute

One ofstringstring-arrayintegerinteger-arraynumbernumber-arrayboolean

sourcesarray<string>

All sources where this attribute key is defined. Can contain 'saml', 'sanity', or both. When both sources exist, it indicates the same attribute key is defined in both SAML and API-managed contexts.

createdAtstring (date-time)

Timestamp when the definition was first created (uses earliest created definition when multiple sources exist)

alreadyExistsboolean

Only present in POST responses. When true, indicates the definition already existed and was returned instead of being created.

json
{
  "key": "year_started",
  "type": "string",
  "sources": [
    "saml",
    "sanity"
  ],
  "createdAt": "2026-01-08T12:00:00Z",
  "alreadyExists": true
}

Need more? See the Sanity guide for connection setup and behaviour shared by every action.