Skip to content
Objects
  1. Docs
  2. API
  3. Objects

Objects

Objects are your workspace's record systems — Deals, Candidates, Properties, whatever you track — plus Attria's built-in ones. Agents read and write them; your code can too, with the same checks the app applies.

#Objects and fields

List the objects to learn each one's key and fields. A field's key is what record values use; its type says what a value may be; choice fields list their options.

curl "https://app.attria.io/api/v1/objects?kind=custom" \
  -H "Authorization: Bearer $ATTRIA_API_KEY"
kindIs
customRecord systems the workspace made. Their records live under /v1/objects/{key}/records.
systemAttria's built-in objects (agents, websites, image_boards, video_boards, files). They can be linked to and carry extra fields; their records belong to their own feature.

#Make an object

The same thing New object makes in the app. Its key is the plural name in snake_case (Deals → deals) and never changes, so code that uses it keeps working. If the key is taken the answer is 409, so a retried create never makes a twin.

curl -X POST "https://app.attria.io/api/v1/objects" \
  -H "Authorization: Bearer $ATTRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "singular_name": "Deal",
    "plural_name": "Deals",
    "fields": [
      {
        "label": "Name",
        "type": "text",
        "required": true
      },
      {
        "label": "Value",
        "type": "currency"
      },
      {
        "label": "Stage",
        "type": "stage",
        "options": [
          "New",
          "Proposal",
          "Won",
          "Lost"
        ]
      },
      {
        "label": "Contact email",
        "type": "email"
      }
    ]
  }'

#Write records

values is keyed by field key and checked exactly as the app checks it: unknown keys, missing required fields and wrong types are refused with 422 and a message naming the field. Choice fields take an option's id or its label.

curl -X POST "https://app.attria.io/api/v1/objects/deals/records" \
  -H "Authorization: Bearer $ATTRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "values": {
      "name": "Acme renewal",
      "value": 12000,
      "stage": "Proposal",
      "contact_email": "ana@acme.com"
    }
  }'

Updates change only the keys you send, merged under a row lock so they never overwrite an edit an agent or a person made a moment earlier. Send null to clear a field.

curl -X PATCH "https://app.attria.io/api/v1/objects/deals/records/3e8d1c2b-7a6f-4e5d-9c8b-1a2f3e4d5c6b" \
  -H "Authorization: Bearer $ATTRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "values": {
      "stage": "Won",
      "value": 14500
    }
  }'

#Query records

curl "https://app.attria.io/api/v1/objects/deals/records?filter=%7B%22stage%22%3A%22Won%22%7D&sort=-value&limit=20" \
  -H "Authorization: Bearer $ATTRIA_API_KEY"
ParameterDoes
filterA JSON object of field key → value; every pair must match. A choice matches by id or label; for a multi_select a list matches records that contain all of it; null matches an empty field.
searchText found anywhere in the record's values, case-insensitive.
sortupdated_at, created_at or any field key; prefix - for descending. Default -updated_at.
limitPage size; pass the previous page's next_cursor as cursor.

#Relationships

Link any record to any other under a relation_key such as company or owner — including built-in objects, like an agent. Sending the same link again returns the existing one.

curl -X POST "https://app.attria.io/api/v1/objects/deals/records/3e8d1c2b-7a6f-4e5d-9c8b-1a2f3e4d5c6b/relationships" \
  -H "Authorization: Bearer $ATTRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "relation_key": "company",
    "target": {
      "object": "companies",
      "id": "0b6f4e3d-2c1b-4a9f-8e7d-6c5b4a3f2e1d"
    },
    "label": "Buyer"
  }'

Deleting a record also deletes every relationship to or from it, and can't be undone.

#Endpoints