# Templates API

> Reusable post content with media and network options.

Base URL: `https://api.socialit.com/v1`. Authenticate with `Authorization: Bearer <API key or OAuth token>`.

## List templates

`GET /templates`

Access: `read` · MCP tool: `list-templates`

### Query parameters

- `page` (integer; ≥ 1): Page number
- `limit` (integer; 1–100): Items per page (max 100)
- `sort` (string; one of created_at, name, updated_at)
- `order` (string; one of asc, desc)
- `match` (string; one of all, or): Combine filters with AND (default) or OR
- `search` (string; ≤ 200 characters)
- `tag` (string)

```bash
curl "https://api.socialit.com/v1/templates" \
  -H "Authorization: Bearer $SOCIALIT_API_KEY"
```

Response 200:

```json
{
  "object": "list",
  "data": [
    {
      "object": "template",
      "id": "string",
      "name": "string",
      "alias": "string",
      "content": "string",
      "media": [
        {
          "media_id": "string",
          "type": "string",
          "url": "https://example.com",
          "thumbnail_url": "https://example.com",
          "position": 1
        }
      ],
      "platform_options": {},
      "first_comment": "string",
      "tags": [
        "string"
      ],
      "created_at": "2026-10-13T09:00:00.000Z",
      "updated_at": "2026-10-13T09:00:00.000Z"
    }
  ],
  "page": 1,
  "limit": 1,
  "total": 1,
  "has_more": true,
  "next_page_url": "https://example.com",
  "previous_page_url": "https://example.com"
}
```

## Create a template

`POST /templates`

Access: `write` · MCP tool: `create-template`

### Headers

- `Idempotency-Key` (string; ≤ 255 characters): Unique key (for example a UUID) that makes retries safe: a repeated request with the same key and body returns the first response (Idempotent-Replayed: true) for 24 hours.

### Body

- `name` (string; required; 1–200 characters)
- `alias` (string | null; ≤ 100 characters)
- `content` (string; required; ≤ 63206 characters)
- `media_ids` (array of string; ≤ 35 items)
- `platform_options` (object)
- `first_comment` (string | null; ≤ 10000 characters)
- `tags` (array of string; ≤ 50 items)

```bash
curl -X POST "https://api.socialit.com/v1/templates" \
  -H "Authorization: Bearer $SOCIALIT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "alias": "string",
    "content": "string",
    "media_ids": [
      "med_2Jx0Fq5Pz8vYkB3mN6rT1wQ9sLd"
    ],
    "platform_options": {}
  }'
```

Response 201:

```json
{
  "object": "template",
  "id": "string",
  "name": "string",
  "alias": "string",
  "content": "string",
  "media": [
    {
      "media_id": "string",
      "type": "string",
      "url": "https://example.com",
      "thumbnail_url": "https://example.com",
      "position": 1
    }
  ],
  "platform_options": {},
  "first_comment": "string",
  "tags": [
    "string"
  ],
  "created_at": "2026-10-13T09:00:00.000Z",
  "updated_at": "2026-10-13T09:00:00.000Z"
}
```

## Get a template

`GET /templates/{id}`

Access: `read` · MCP tool: `get-template`

### Path parameters

- `id` (string; required; 1–80 characters): template id (tem_…)

```bash
curl "https://api.socialit.com/v1/templates/tem_2Jx0Fq5Pz8vYkB3mN6rT1wQ9sLd" \
  -H "Authorization: Bearer $SOCIALIT_API_KEY"
```

Response 200:

```json
{
  "object": "template",
  "id": "string",
  "name": "string",
  "alias": "string",
  "content": "string",
  "media": [
    {
      "media_id": "string",
      "type": "string",
      "url": "https://example.com",
      "thumbnail_url": "https://example.com",
      "position": 1
    }
  ],
  "platform_options": {},
  "first_comment": "string",
  "tags": [
    "string"
  ],
  "created_at": "2026-10-13T09:00:00.000Z",
  "updated_at": "2026-10-13T09:00:00.000Z"
}
```

## Update a template

`PATCH /templates/{id}`

Access: `write` · MCP tool: `update-template`

### Path parameters

- `id` (string; required; 1–80 characters): template id (tem_…)

### Body

- `name` (string; 1–200 characters)
- `alias` (string | null; ≤ 100 characters)
- `content` (string; ≤ 63206 characters)
- `media_ids` (array of string; ≤ 35 items)
- `platform_options` (object)
- `first_comment` (string | null; ≤ 10000 characters)
- `tags` (array of string; ≤ 50 items)

```bash
curl -X PATCH "https://api.socialit.com/v1/templates/tem_2Jx0Fq5Pz8vYkB3mN6rT1wQ9sLd" \
  -H "Authorization: Bearer $SOCIALIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "alias": "string",
    "content": "string",
    "media_ids": [
      "med_2Jx0Fq5Pz8vYkB3mN6rT1wQ9sLd"
    ],
    "platform_options": {}
  }'
```

Response 200:

```json
{
  "object": "template",
  "id": "string",
  "name": "string",
  "alias": "string",
  "content": "string",
  "media": [
    {
      "media_id": "string",
      "type": "string",
      "url": "https://example.com",
      "thumbnail_url": "https://example.com",
      "position": 1
    }
  ],
  "platform_options": {},
  "first_comment": "string",
  "tags": [
    "string"
  ],
  "created_at": "2026-10-13T09:00:00.000Z",
  "updated_at": "2026-10-13T09:00:00.000Z"
}
```

## Delete a template

`DELETE /templates/{id}`

Access: `write` · MCP tool: `delete-template`

### Path parameters

- `id` (string; required; 1–80 characters): template id (tem_…)

```bash
curl -X DELETE "https://api.socialit.com/v1/templates/tem_2Jx0Fq5Pz8vYkB3mN6rT1wQ9sLd" \
  -H "Authorization: Bearer $SOCIALIT_API_KEY"
```

Response 200:

```json
{
  "object": "template",
  "id": "string",
  "deleted": true
}
```


---

Source: https://socialit.com/docs/api-reference/templates/
