nodestash
Contacts

Create a new contact

Creates a new contact in the authenticated workspace. If an `email` is provided it must be unique within the workspace. All fields are optional — at minimum you should provide an email or a name so the contact is identifiable.

POST
/contacts
AuthorizationBearer <token>

API key from your nodestash dashboard. Pass as a Bearer token in the Authorization header.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.nodestash.io/v1/contacts" \  -H "Content-Type: application/json" \  -d '{    "email": "jane@acme.com",    "first_name": "Jane",    "last_name": "Doe",    "phone": "+1-555-0100",    "company_id": "co_xyz789",    "title": "VP of Engineering",    "source": "website",    "custom_fields": {      "plan": "enterprise"    },    "tags": [      "vip",      "early-adopter"    ]  }'
{
  "data": {
    "id": "ct_5hJ3kM9pQrVwXyZaB2cD4",
    "type": "contact",
    "attributes": {
      "id": "ct_5hJ3kM9pQrVwXyZaB2cD4",
      "email": "jane@acme.com",
      "first_name": "Jane",
      "last_name": "Doe",
      "phone": "+1-555-0100",
      "company_id": "co_xyz789",
      "title": "VP of Engineering",
      "source": "website",
      "custom_fields": {
        "plan": "enterprise"
      },
      "tags": [
        "vip",
        "early-adopter"
      ],
      "created_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-01-15T10:30:00Z"
    }
  },
  "meta": {
    "request_id": "req_7nR4tW8xKqMvPyZbC3dF5"
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "details": [
      {
        "field": "email",
        "message": "Invalid email"
      }
    ]
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}
{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Missing or invalid Authorization header"
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}
{
  "error": {
    "code": "CONFLICT",
    "message": "A contact with email 'jane@acme.com' already exists in this workspace"
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded"
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}