Assistants

List messages

Returns a list of messages for a given thread.

get/threads/{thread_id}/messages

Path parameters

thread_idstring required

The ID of the thread the messages belong to.

Query parameters

limitinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

order'asc' | 'desc'

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

afterstring

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

beforestring

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

run_idstring

Filter messages by the run ID that generated them.

Response

OK

objectstring required
first_idstring required
last_idstring required
has_moreboolean required

Example response

{
  "object": "list",
  "first_id": "msg_abc123",
  "last_id": "msg_abc123"
}

Changes

Changed in 4 of the 163 revisions of this API.93

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

  • 74cbcf73838f81See the full diff
    • ▲

      response property data/items/assistant_id list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      response property data/items/attachments list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      response property data/items/completed_at list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      response property data/items/incomplete_at list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      response property data/items/metadata list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      response property data/items/run_id list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      the // response's property type changed from object to no type for status

      response-property-type-changed

    • ▲

      removed the required property /// from the response with the status

      response-required-property-removed

    • ○

      added subschema #1 subschema #2 to the // response property anyOf list for the response status

      response-property-any-of-added

    This revision also has 40 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ▲

      added to the /// response property oneOf list for the response status

      response-property-one-of-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog