---
title: "Outgoing messages of a workspace"
method: GET
path: "/api/v1/workspaces/{workspaceId}/messages"
tags: ["Messages"]
---

# Outgoing messages of a workspace

`GET /api/v1/workspaces/{workspaceId}/messages`

## Request

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

## Path parameters

- `workspaceId` integer, required

## Query parameters

- `cursor` string
- `limit` integer
- `status` 'queued' | 'sending' | 'sent' | 'delivered' | 'read' | 'failed'
- `outcome` 'delivered' | 'on_the_way' | 'retrying' | 'unconfirmed' | 'undecrypted' | 'not_delivered'
- `slot_id` string: Only messages sent from this slot
- `to` string

## Response `200`

OK

- PageOutputBody4
  - `items` MessageBody[], nullable, required
    - `attempts` integer, required
    - `body` string, required
    - `channel` 'whatsapp_gateway' | 'telegram' | 'telegram_gateway' | 'whatsapp_official', required
    - `contact_name` string, required: Name of the recipient in the address book, empty if not saved
    - `created_at` string, date-time, required
    - `delivered_at` string, date-time, nullable, required
    - `edited_at` string, date-time, nullable, required: When the text was last edited after sending, null if never
    - `error_code` string, required
    - `error_detail` string, required: The error WhatsApp returned on the last failed attempt, empty when there was none
    - `failed_at` string, date-time, nullable, required
    - `id` string, uuid, required
    - `media` MessageMediaBody, required
      - `filename` string, required
      - `kind` 'image' | 'video' | 'document', required
      - `url` string, required: Address the file was downloaded from
    - `outcome` 'delivered' | 'on_the_way' | 'retrying' | 'unconfirmed' | 'undecrypted' | 'not_delivered', required: What happened to the message in plain terms: unconfirmed means WhatsApp accepted it but the phone has not confirmed it for 10 minutes
    - `project_id` integer, required
    - `purpose` 'notification' | 'otp', required
    - `read_at` string, date-time, nullable, required
    - `revoked_at` string, date-time, nullable, required: When the message was deleted for everyone, null if not
    - `scheduled_at` string, date-time, required: Earliest moment the gateway sends the message
    - `sent_at` string, date-time, nullable, required
    - `slot_id` string, nullable, required
    - `status` 'queued' | 'sending' | 'sent' | 'delivered' | 'read' | 'failed', required
    - `to_phone` string, required
  - `next_cursor` string, nullable, required

## Other responses

- `404`: Not Found
- `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)
