Amarsia
API Reference

Resources API

Create, read, update, and delete resources in your workspace.

List resources

GET /v1/resources

Query parameters

ParameterTypeDescription
typestringFilter by resource type
limitintegerResults per page (default: 20, max: 100)
cursorstringPagination cursor from previous response

Response

{
  "data": [
    {
      "id": "res_01j...",
      "type": "contact",
      "fields": {
        "email": "jane@example.com",
        "name": "Jane Doe"
      },
      "created_at": "2025-01-01T00:00:00Z",
      "updated_at": "2025-01-01T00:00:00Z"
    }
  ],
  "meta": {
    "nextCursor": "cursor_...",
    "hasMore": true
  }
}

Get resource

GET /v1/resources/:id

Response

{
  "data": {
    "id": "res_01j...",
    "type": "contact",
    "fields": { ... },
    "created_at": "2025-01-01T00:00:00Z",
    "updated_at": "2025-01-01T00:00:00Z"
  }
}

Create resource

POST /v1/resources

Body

FieldTypeRequiredDescription
typestringYesResource type
fieldsobjectYesKey-value pairs for the resource

Request

curl -X POST https://api.amarsia.com/v1/resources \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "contact",
    "fields": {
      "email": "jane@example.com",
      "name": "Jane Doe"
    }
  }'

Response: 201 Created

{
  "data": {
    "id": "res_01j...",
    "type": "contact",
    "fields": {
      "email": "jane@example.com",
      "name": "Jane Doe"
    },
    "created_at": "2025-01-01T00:00:00Z",
    "updated_at": "2025-01-01T00:00:00Z"
  }
}

Update resource

Performs a partial update — only the fields you include are changed.

PATCH /v1/resources/:id

Body

FieldTypeRequiredDescription
fieldsobjectYesFields to update

Delete resource

DELETE /v1/resources/:id

Response: 204 No Content