# List Sent Messages

Retrieves a list of all sent messages.

Endpoint: GET /v2/sent_messages
Version: 1.0.0
Security: apiKeyAuth, practiceGroupId

## Security:

  - `apiKeyAuth` (unknown)
    apiKey in header x-api-key

  - `practiceGroupId` (unknown)
    apiKey in header x-practice-group-id

## Query parameters:

  - `page_index` (string)

  - `page_size` (string)

  - `order_by` (string)

  - `order_descending` (boolean)

  - `patient_first_name` (string)

  - `patient_last_name` (string)

  - `patient_full_name` (string)

  - `patient_id` (string)

  - `recipient_contact_detail` (string)

  - `write_to_record_status` (string)

  - `message_type` (any)

  - `short_link_id` (string)

  - `short_link_type` (string)

  - `campaign_id` (string)

  - `status` (any)

  - `scheduled` (boolean)

  - `sent_by` (string)

  - `sent_at[]` (array)

  - `scheduled_at[]` (array)

## Response 200:

  - `200` (unknown)
    Ok

## Response 200 fields (application/json):

  - `data` (array, required)

  - `data.id` (string, required)

  - `data.patient` (object, required)

  - `data.patient.id` (string, required)

  - `data.patient.title` (string, required)
    Enum: "Baron", "Baroness", "Brigadier", "Count", "Colonel", "Countess", "Captain", "Dame", "The Dowager Viscountess", "Dr", "Duchess", "Duke", "Earl", "His Excellency", "Father", "H.E. Ambassador Mr", "H.E. Mr", "H.E. Mrs", "Her Grace", "His Grace", "The Hon", "The Hon Mr", "The Hon Mrs", "HRH", "HRH Prince", "HRH Princess", "Insurance", "HM King", "Lady", "Lord", "Major", "Master", "Miss", "Mr", "Mrs", "Ms", "Mss", "Mx", "Pr", "Professor", "HM Queen", "Rabbi", "Reverend", "Sheikh", "Sheikha", "Sir", "The", "", "Viscount", "Viscountess"

  - `data.patient.first_name` (string, required)

  - `data.patient.last_name` (string, required)

  - `data.write_to_record` (object, required)

  - `data.write_to_record.write_to_record_at` (string, required)

  - `data.write_to_record.status` (string, required)

  - `data.write_to_record.failure_reason` (string, required)

  - `data.write_to_record.snomed_code` (string, required)

  - `data.short_link` (object, required)

  - `data.short_link.id` (string)

  - `data.short_link.type` (string)

  - `data.short_link.name` (string)

  - `data.short_link.status` (string)

  - `data.campaign` (object, required)

  - `data.campaign.id` (string)

  - `data.campaign.name` (string)

  - `data.created_at` (string, required)

  - `data.sent_at` (string, required)

  - `data.scheduled_at` (string, required)

  - `data.status` (string, required)
    Enum: "delivered", "declined", "sent", "pending", "retry", "fatal"

  - `data.sent_by` (string, required)

  - `data.recipient_contact_detail` (string, required)

  - `data.message_type` (string, required)

  - `data.message` (string, required)

  - `data.attachment` (object, required)

  - `data.attachment.filename` (string, required)

  - `data.attachment.short_link_id` (string, required)

  - `count` (number, required)

## Response 400:

  - `400` (unknown)
    Validation error

## Response 400 fields (application/json):

  - `error` (boolean, required)
    Example: true

  - `statusCode` (number, required)
    Example: 400

  - `message` (array, required)

  - `message.code` (string, required)
    Example: invalid_type

  - `message.expected` (string, required)
    Example: string

  - `message.path` (array, required)
    Example: ["patient_id"]

  - `message.message` (string, required)
    Example: Required

## Response 401:

  - `401` (unknown)
    Unauthorised

## Response 404:

  - `404` (unknown)
    Not found

## Response 429:

  - `429` (unknown)
    Too Many Requests

## Response 500:

  - `500` (unknown)
    Unknown error

