---
title: "Create a slot for a WhatsApp number"
method: POST
path: "/api/v1/workspaces/{workspaceId}/slots"
tags: ["WhatsApp slots"]
---

# Create a slot for a WhatsApp number

`POST /api/v1/workspaces/{workspaceId}/slots`

## Request

- Base URL: `https://otprun.com`
- URL: `https://otprun.com/api/v1/workspaces/{workspaceId}/slots`
- Auth: HTTP bearer

## Path parameters

- `workspaceId` integer, required

## Request body

- CreateInputBody3
  - `history_depth` integer: How many past messages of each chat to import from the phone, 50 when omitted; 0 keeps only new messages
  - `label` string, required
  - `project_ids` string[]: Projects that send from this number and receive its replies, all projects of the workspace when omitted

## Response `201`

Created

- SlotBody
  - `created_at` string, date-time, required
  - `history_depth` integer, required: How many past messages of each chat OTP Run imports from the phone; 0 keeps only new messages
  - `id` string, required
  - `label` string, required
  - `last_error` string, required
  - `last_seen_at` string, date-time, nullable, required
  - `pairing_mode` string, required: code, qr or empty before the first pairing
  - `paused_until` string, date-time, nullable, required
  - `phone` string, required: E.164, empty until paired
  - `project_ids` string[], nullable, required: Projects that send from this number and receive its replies
  - `sent_today` integer, required
  - `state` 'new' | 'pairing' | 'connected' | 'disconnected' | 'logged_out' | 'banned', required
  - `updated_at` string, date-time, required
  - `workspace_id` integer, required

## Other responses

- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/otprun/apis/otp-run-api.md) · [All operations](https://skmtc.dev/otprun/apis/otp-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/otprun/apis/otp-run-api/revisions/43d40d5f4050?raw)
