Browse documentation

Carebit API

Letters

Letters written or received on behalf of a Patient.

Endpoints

Scroll this page to read every Letters endpoint, or jump to one below.

post/v1/letter_batches

Create up to 100 Letters in one request

Each item accepts a public HTTPS file_url or Base64-encoded file_base64. Carebit creates all Letters together. If any item fails validation, no Letters are created.

Required API scopes: letters.create

Parameters

  • Idempotency-Key

    header · required

    string

    Client-generated idempotency key. Required for every POST/PATCH write. Replay of the same key with the same body returns the stored response with an Idempotency-Replayed: true header. Same key + different body returns 422 idempotency_key_reused. A duplicate that arrives while the first request is still in flight returns 409 idempotency_conflict with Retry-After: 1.

Request body

application/json

  • itemsarrayrequired

    The letters to create. Items are processed in their submitted order.

    • itemsobject
      • automatically_create_resource_permission_for_patientboolean

        Whether Carebit should automatically share the letter with the patient after processing.

      • booking_idstring | null · uuid

        The identifier of the booking associated with the letter, or null when it is not linked to a booking.

      • clinician_idstring | null · uuid

        The identifier of the clinician associated with the letter, or null when none is assigned.

      • descriptionstring | null

        A description of the Letter.

      • file_base64string · byte

        The letter bytes encoded as Base64. Provide this with filename instead of file_url. The decoded file can be at most 7 MB.

      • file_urlstring · uri

        The public HTTPS URL that Carebit can fetch.

      • filenamestring | null

        The filename to use for the letter. Required with file_base64; defaults to the remote file's filename for URL sources.

      • notify_patient_of_resource_permissionboolean

        Whether Carebit should notify the patient when the letter is shared with them.

      • patient_idstring · uuid

        The identifier of the patient that the letter belongs to.

      • statusstring

        The workflow status to assign to the letter.

        Allowed values: awaiting_receipt | awaiting_review | awaiting_sending | complete | draft | reviewed

      • titlestring

        The display title of the letter.

Responses

202

The batch was accepted. Poll it for each file's import status.

  • completed_countintegerrequired

    The number of items that finished processing successfully.

  • created_atstring · date-timerequired

    An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

  • failed_countintegerrequired

    The number of items that finished processing with an error.

  • idstring · uuidrequired

    The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.

  • itemsarrayrequired

    The import items in their original request order.

    • itemsobject
      • created_resourcestring | null · urirequired

        The URL of the resource created for a succeeded item. Null unless status is succeeded.

      • created_resource_idstring | null · uuidrequired

        The identifier of the resource created for a succeeded item. Null unless status is succeeded.

      • created_resource_typestring | nullrequired

        The type of resource created for a succeeded item. Null unless status is succeeded.

        Allowed values: null | Attachment | Letter | Note | TestResult

      • errorobject | nullrequired

        The failure details for this item. Null unless the item has failed.

        • codestring | nullrequired

          The machine-readable error code.

        • messagestring | nullrequired

          A message that explains how the item failed.

      • idstring · uuidrequired

        The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.

      • objectanyrequired

        Always remote_file_import_batch_item.

      • positionintegerrequired

        The zero-based position of the item in the submitted batch.

      • statusstringrequired

        The current download, validation, and malware-scanning status of the item.

        Allowed values: failed | pending | processing | succeeded

  • linksobjectrequired

    URLs to related resources.

    • selfstring · urirequired

      The full URL of a related resource.

  • objectanyrequired

    Discriminator value emitted at object.

  • resource_typestringrequired

    The type of resource created by every item in the batch.

    Allowed values: letter | note | test_result

  • statusstringrequired

    The current download, validation, and malware-scanning status of the batch.

    Allowed values: completed | pending | processing

  • total_countintegerrequired

    The total number of items submitted in the batch.

  • updated_atstring · date-timerequired

    An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

Example
{
  "id": "ebc38802-f219-4c7b-8136-8e963a0c69e0",
  "object": "remote_file_import_batch",
  "completed_count": 0,
  "created_at": "2026-01-01T09:00:00Z",
  "failed_count": 0,
  "items": 
    
      "id": "57bed2bf-e2e1-463b-8a96-643e3817a8b8",
      "object": "remote_file_import_batch_item",
      "created_resource": "https://api.carebit.co/v1/letters/c3d4e5f6-0718-49ab-acde-f01234567890",
      "created_resource_id": "7e09a8e3-e3c1-4dee-863b-85d56e4329da",
      "created_resource_type": null,
      "error": null,
      "position": 0,
      "status": "failed"
    }
  ],
  "links": 
    "self": "https://api.carebit.co/v1/remote_file_import_batches/ebc38802-f219-4c7b-8136-8e963a0c69e0"
  },
  "resource_type": "letter",
  "status": "completed",
  "total_count": 1,
  "updated_at": "2026-01-01T09:00:00Z"
}
400

The Idempotency-Key header is missing (idempotency_key_required) or exceeds 255 characters (idempotency_key_too_long).

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
401

The access token is missing, invalid, expired, or revoked.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
403

The access token lacks the required scope, or the project is disabled.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
404

Error response.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
409

A concurrent request holds the idempotency lease (idempotency_conflict). Retry after the delay indicated by Retry-After.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
422

The Idempotency-Key was previously used with a different request body (idempotency_key_reused), or the request body failed validation.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
429

Too many requests. Retry after the delay indicated by Retry-After.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
get/v1/letters

List Letters

Required API scopes: letters.read

Parameters

  • patient_id

    query

    string

    -

  • booking_id

    query

    string

    -

  • status

    query

    string · enum: awaiting_proofreading | awaiting_receipt | awaiting_review | awaiting_sending | awaiting_typing | complete | draft | reviewed

    -

  • created_since

    query

    string

    -

  • limit

    query

    integer

    The maximum number of items to return. Defaults to 25; the maximum is 100.

  • starting_after

    query

    string

    Return items after this resource ID. You cannot use this with cursor.

  • cursor

    query

    string

    The next_cursor value from the previous page. You cannot use this with starting_after.

Responses

200

Paginated list of Letter objects.

  • dataarrayrequired
    • itemsobject
      • automatically_create_resource_permission_for_patientbooleanrequired

        Whether Carebit automatically shares the letter with the patient after processing.

      • created_atstring · date-timerequired

        An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

      • download_urlstring | null · urirequired

        The short-lived signed download URL for the Letter. Null until the uploaded file passes malware scanning.

      • filenamestring | nullrequired

        The original filename of the letter document.

      • idstring · uuidrequired

        The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.

      • linksobjectrequired

        URLs to related resources.

        • bookingstring | null · urirequired

          The full URL of a related resource.

        • clinicianstring | null · urirequired

          The full URL of a related resource.

        • patientstring | null · urirequired

          The full URL of a related resource.

        • remote_file_import_batchstring · uri

          The full URL of a related resource.

      • notify_patient_of_resource_permissionboolean | nullrequired

        Whether Carebit notifies the patient when the letter is shared with them.

      • objectanyrequired

        Discriminator value emitted at object.

      • remote_file_import_batch_idstring · uuid

        The identifier of the remote file import batch created for the uploaded file. Set on the create response. Poll /v1/remote_file_import_batches/:id for processing status.

      • sent_atstring | null · date-timerequired

        An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

      • statusstring | nullrequired

        The Letter's workflow status. Null while the Letter is being created.

        Allowed values: awaiting_proofreading | awaiting_receipt | awaiting_review | awaiting_sending | awaiting_typing | complete | draft | reviewed | null

      • titlestring | nullrequired

        The display title of the letter.

      • updated_atstring · date-timerequired

        An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

  • has_morebooleanrequired

    Whether another page is available after next_cursor.

  • next_cursorstring | nullrequired

    The value to pass as cursor for the next page. Null on the last page.

  • objectanyrequired

    Always list.

  • urlstringrequired

    The API path that returned this list.

Example
{
  "object": "list",
  "data": 
    
      "id": "c3d4e5f6-0718-49ab-acde-f01234567890",
      "object": "letter",
      "automatically_create_resource_permission_for_patient": true,
      "created_at": "2026-01-01T09:00:00Z",
      "download_url": "https://files.example.invalid/document.pdf?signature=test",
      "filename": "referral-letter.pdf",
      "links": 
        "booking": "https://api.carebit.co/v1/bookings/92a3b4c5-d6e7-4f01-8234-56789abcdef0",
        "clinician": "https://api.carebit.co/v1/clinicians/2b3c4d5e-6f70-489a-9bcd-ef0123456789",
        "patient": "https://api.carebit.co/v1/patients/1a2b3c4d-5e6f-4789-8abc-def012345678",
        "remote_file_import_batch": "https://api.carebit.co/v1/remote_file_import_batches/ebc38802-f219-4c7b-8136-8e963a0c69e0"
      },
      "notify_patient_of_resource_permission": true,
      "remote_file_import_batch_id": "ebc38802-f219-4c7b-8136-8e963a0c69e0",
      "sent_at": "2026-01-01T09:00:00Z",
      "status": "awaiting_proofreading",
      "title": "Dr",
      "updated_at": "2026-01-01T09:00:00Z"
    }
  ],
  "has_more": false,
  "next_cursor": "eyJzdGFydF90aW1lIjoiMjAyNi0wMS0wMVQwOTowMDowMFoifQ",
  "url": "/v1/letters"
}
400

A filter or pagination parameter is invalid.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
401

The access token is missing, invalid, expired, or revoked.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
403

The access token lacks the required scope, or the project is disabled.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
429

Too many requests. Retry after the delay indicated by Retry-After.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
post/v1/letters

Create a Letter with a file

Creates the Letter immediately, then imports its file in the background. Provide the file as a public HTTPS file_url or Base64-encoded file_base64. Poll /v1/remote_file_import_batches/:remote_file_import_batch_id for the import status.

Required API scopes: letters.create

Parameters

  • Idempotency-Key

    header · required

    string

    Client-generated idempotency key. Required for every POST/PATCH write. Replay of the same key with the same body returns the stored response with an Idempotency-Replayed: true header. Same key + different body returns 422 idempotency_key_reused. A duplicate that arrives while the first request is still in flight returns 409 idempotency_conflict with Retry-After: 1.

Request body

application/json

  • automatically_create_resource_permission_for_patientbooleanrequired

    Whether Carebit should automatically share the letter with the patient after processing.

  • booking_idstring | null · uuid

    The identifier of the booking associated with the letter, or null when it is not linked to a booking.

  • clinician_idstring | null · uuid

    The identifier of the clinician associated with the letter, or null when none is assigned.

  • descriptionstring | null

    A description of the Letter.

  • file_base64string · byte

    The letter bytes encoded as Base64. Provide this with filename instead of file_url. The decoded file can be at most 7 MB.

  • file_urlstring · uri

    The public HTTPS URL that Carebit can fetch.

  • filenamestring | null

    The filename to use for the letter. Required with file_base64; defaults to the remote file's filename for URL sources.

  • notify_patient_of_resource_permissionbooleanrequired

    Whether Carebit should notify the patient when the letter is shared with them.

  • patient_idstring · uuidrequired

    The identifier of the patient that the letter belongs to.

  • statusstringrequired

    The workflow status to assign to the letter.

    Allowed values: awaiting_receipt | awaiting_review | awaiting_sending | complete | draft | reviewed

  • titlestringrequired

    The display title of the letter.

Responses

201

The requested Letter.

  • automatically_create_resource_permission_for_patientbooleanrequired

    Whether Carebit automatically shares the letter with the patient after processing.

  • created_atstring · date-timerequired

    An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

  • download_urlstring | null · urirequired

    The short-lived signed download URL for the Letter. Null until the uploaded file passes malware scanning.

  • filenamestring | nullrequired

    The original filename of the letter document.

  • idstring · uuidrequired

    The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.

  • linksobjectrequired

    URLs to related resources.

    • bookingstring | null · urirequired

      The full URL of a related resource.

    • clinicianstring | null · urirequired

      The full URL of a related resource.

    • patientstring | null · urirequired

      The full URL of a related resource.

    • remote_file_import_batchstring · uri

      The full URL of a related resource.

  • notify_patient_of_resource_permissionboolean | nullrequired

    Whether Carebit notifies the patient when the letter is shared with them.

  • objectanyrequired

    Discriminator value emitted at object.

  • remote_file_import_batch_idstring · uuid

    The identifier of the remote file import batch created for the uploaded file. Set on the create response. Poll /v1/remote_file_import_batches/:id for processing status.

  • sent_atstring | null · date-timerequired

    An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

  • statusstring | nullrequired

    The Letter's workflow status. Null while the Letter is being created.

    Allowed values: awaiting_proofreading | awaiting_receipt | awaiting_review | awaiting_sending | awaiting_typing | complete | draft | reviewed | null

  • titlestring | nullrequired

    The display title of the letter.

  • updated_atstring · date-timerequired

    An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

Example
{
  "id": "c3d4e5f6-0718-49ab-acde-f01234567890",
  "object": "letter",
  "automatically_create_resource_permission_for_patient": true,
  "created_at": "2026-01-01T09:00:00Z",
  "download_url": "https://files.example.invalid/document.pdf?signature=test",
  "filename": "referral-letter.pdf",
  "links": 
    "booking": "https://api.carebit.co/v1/bookings/92a3b4c5-d6e7-4f01-8234-56789abcdef0",
    "clinician": "https://api.carebit.co/v1/clinicians/2b3c4d5e-6f70-489a-9bcd-ef0123456789",
    "patient": "https://api.carebit.co/v1/patients/1a2b3c4d-5e6f-4789-8abc-def012345678",
    "remote_file_import_batch": "https://api.carebit.co/v1/remote_file_import_batches/ebc38802-f219-4c7b-8136-8e963a0c69e0"
  },
  "notify_patient_of_resource_permission": true,
  "remote_file_import_batch_id": "ebc38802-f219-4c7b-8136-8e963a0c69e0",
  "sent_at": "2026-01-01T09:00:00Z",
  "status": "awaiting_proofreading",
  "title": "Dr",
  "updated_at": "2026-01-01T09:00:00Z"
}
400

The Idempotency-Key header is missing (idempotency_key_required) or exceeds 255 characters (idempotency_key_too_long).

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
401

The access token is missing, invalid, expired, or revoked.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
403

The access token lacks the required scope, or the project is disabled.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
404

Error response.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
409

A concurrent request holds the idempotency lease (idempotency_conflict). Retry after the delay indicated by Retry-After.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
422

The Idempotency-Key was previously used with a different request body (idempotency_key_reused), or the request body failed validation.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
429

Too many requests. Retry after the delay indicated by Retry-After.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
get/v1/letters/:id

Get a Letter

Required API scopes: letters.read

Parameters

  • id

    path · required

    string

    -

Responses

200

The requested Letter.

  • automatically_create_resource_permission_for_patientbooleanrequired

    Whether Carebit automatically shares the letter with the patient after processing.

  • created_atstring · date-timerequired

    An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

  • download_urlstring | null · urirequired

    The short-lived signed download URL for the Letter. Null until the uploaded file passes malware scanning.

  • filenamestring | nullrequired

    The original filename of the letter document.

  • idstring · uuidrequired

    The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.

  • linksobjectrequired

    URLs to related resources.

    • bookingstring | null · urirequired

      The full URL of a related resource.

    • clinicianstring | null · urirequired

      The full URL of a related resource.

    • patientstring | null · urirequired

      The full URL of a related resource.

    • remote_file_import_batchstring · uri

      The full URL of a related resource.

  • notify_patient_of_resource_permissionboolean | nullrequired

    Whether Carebit notifies the patient when the letter is shared with them.

  • objectanyrequired

    Discriminator value emitted at object.

  • remote_file_import_batch_idstring · uuid

    The identifier of the remote file import batch created for the uploaded file. Set on the create response. Poll /v1/remote_file_import_batches/:id for processing status.

  • sent_atstring | null · date-timerequired

    An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

  • statusstring | nullrequired

    The Letter's workflow status. Null while the Letter is being created.

    Allowed values: awaiting_proofreading | awaiting_receipt | awaiting_review | awaiting_sending | awaiting_typing | complete | draft | reviewed | null

  • titlestring | nullrequired

    The display title of the letter.

  • updated_atstring · date-timerequired

    An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

Example
{
  "id": "c3d4e5f6-0718-49ab-acde-f01234567890",
  "object": "letter",
  "automatically_create_resource_permission_for_patient": true,
  "created_at": "2026-01-01T09:00:00Z",
  "download_url": "https://files.example.invalid/document.pdf?signature=test",
  "filename": "referral-letter.pdf",
  "links": 
    "booking": "https://api.carebit.co/v1/bookings/92a3b4c5-d6e7-4f01-8234-56789abcdef0",
    "clinician": "https://api.carebit.co/v1/clinicians/2b3c4d5e-6f70-489a-9bcd-ef0123456789",
    "patient": "https://api.carebit.co/v1/patients/1a2b3c4d-5e6f-4789-8abc-def012345678",
    "remote_file_import_batch": "https://api.carebit.co/v1/remote_file_import_batches/ebc38802-f219-4c7b-8136-8e963a0c69e0"
  },
  "notify_patient_of_resource_permission": true,
  "remote_file_import_batch_id": "ebc38802-f219-4c7b-8136-8e963a0c69e0",
  "sent_at": "2026-01-01T09:00:00Z",
  "status": "awaiting_proofreading",
  "title": "Dr",
  "updated_at": "2026-01-01T09:00:00Z"
}
401

The access token is missing, invalid, expired, or revoked.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
403

The access token lacks the required scope, or the project is disabled.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
404

Error response.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
429

Too many requests. Retry after the delay indicated by Retry-After.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}

Prefer plain text? Append ?format=md or send Accept: text/markdown to receive this page as raw Markdown.