> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Register a new predicate signature

> **Required scope:** write

**Required scope:** `write`

### Request body

`RegisterPredicateRequest`

<ParamField body="arg_types" type="string[]" required>
  Argument types
</ParamField>

<ParamField body="doc" type="string">
  Documentation
</ParamField>

<ParamField body="name" type="string" required>
  Predicate name
</ParamField>

<ParamField body="return_type" type="string">
  Optional return type (for functional predicates)
</ParamField>

### Response

`PredicateResponse`

<ResponseField name="arg_types" type="string[]" required />

<ResponseField name="arity" type="integer" required />

<ResponseField name="doc" type="string" />

<ResponseField name="name" type="string" required />

<ResponseField name="return_type" type="string" />

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `201` | Predicate registered                               |
| `400` | Invalid predicate definition                       |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `409` | Predicate already exists                           |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/types/predicates' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "arg_types": [
      "entity",
      "location"
    ],
    "doc": "Entity X lived in location Y",
    "name": "lived_in"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "arg_types": [
      "string"
    ],
    "arity": 1,
    "doc": "string",
    "name": "Two-Person Tent",
    "return_type": "string"
  }
  ```
</ResponseExample>
