---
updatedAt: 2026-04-28T10:00:44.000Z
agentTools:
  projectIndex: https://docs.trustpair.com/llms.txt
---

# Retrieve documents assigned to Company Account Audit

Retrieves a paginated list of documents associated with a specific Company Account Audit.

This endpoint allows you to:
- List all documents linked to a company account audit
- Include related resources (user)
- Sort results by creation date
- Paginate through large result sets

Results are sorted by creation date (newest first) by default.

**Required permissions:**
- `documents_read`
- `company_account_audits_read`

**Note:** The document feature must be enabled for your account to access this endpoint.


# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "TRUSTPAIR API",
    "version": "v1",
    "description": "The Trustpair API is organized around REST. Our API has predictable resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.\n\n# Definitions\nThe following API documentation is divided into different definitions. Switch between definitions using the select located at the top right of the page.\n\n# Authentication\n\nThe Trustpair API uses token to authenticate requests.\n\nThe Bearer authentication token must be provided with the request as a header: `Authorization: Bearer <token>`\n\nAll API requests must be made over `HTTPS`. Calls made over plain `HTTP` will fail.\n\nAPI requests without authentication will also fail.\n\n\n### Error response\n\nReturns a `401 UNAUTHORIZED` code if the provided bearer token is not found.\n\n# Rate limits\nLimits are placed on the number of requests that can be made on the Trustpair API (the currently enforced limit being 100 requests over a 10 seconds periods). These limits help us provide the reliable and scalable API that our customers rely on.\n\nIf the defined limit is exceeded, the API will return an HTTP code `429 Too Many Requests`.\n\n\n# Pagination\n\nThe API returns paginated results for list endpoints. By default, the number of items returned is 10.\n\nTrustpair utilizes cursor-based pagination via the `starting_after` and `ending_before` parameters.\nBoth parameters take an existing object ID value and return objects in reverse chronological order.\nThe `ending_before` parameter returns objects listed before the named object. The `starting_after` parameter returns objects listed after the named object.\nIf both parameters are provided, only `ending_before` is used.\n\n\n| Arguments      | Description                                                         | Required                | Example                                                |\n| -------------  |:-------------:                                                      | -----:                  | ---:                                                   |\n| limit          | A limit on the number of objects to be returned, between 1 and 100. | optional, default is 10 | */?limit=2                                             |\n| starting_after | A cursor for use in pagination                                      | optional                | */?starting_after=c58ac778-67b5-4f98-ba33-a1e9aaf394eb |\n| ending_before  | A cursor for use in pagination                                      | optional                | */?ending_before=c58ac778-67b5-4f98-ba33-a1e9aaf394eb  |\n\n\n# Filters\n\nThe API results can be filtered according to different criteria on every endpoint.\n\nThere is no theoric limit on how many different elements can be submitted in a filter, only that the request header should be kept under 8kb.\n\n| Arguments            | Description                                                                                    | Example                                                                                                       |\n| -------------        |:-------------:                                                                                 | ---------------------------------------:                                                                      |\n| ids                  | Returns selected objects                                                                       | /api/v1/paid_payments?ids=a414df38-f13b-48b6-95f7-f941ca121f28,a414df38-f13b-48b6-95f7-f941ca121f29           |\n| recents              | Returns objects evaluated in the last 24 hours                                                 | /api/v1/company_account_audits/recents                                                                        |\n| recents/?last_update | Returns the objects evaluated from the given date (included) (format: `%d/%m/%Y`)              | /api/v1/payment_checks/recents?last_update='01/01/2021'                                                       |\n| state                | Filters by global state (in `pending`, `favorable`, `unfavorable`, `anomaly` or `unevaluated`) | api/v1/company_account_checks/?state=unfavorable                                                              |\n\n# HTTP Codes\n\nTrustpair uses conventional HTTP response codes to indicate the success or failure of an API request.\n\n| Code                       | Description                                                             |\n| -------------              |:-------------:                                                          |\n| 200 - OK                   | Everything worked as expected                                           |\n| 202 - Accepted             | The request has been accepted and processing has not been completed yet |\n| 401 - Unauthorized         | No valid token was provided                                             |\n| 403 - Forbidden            | The token doesn't have permissions for the request                      |\n| 404 - Not found            | The requested resource doesn't exist                                    |\n| 422 - Unprocessable Entity | The request format was invalid                                          |\n| 429 - Too many requests    | The requests limit is exceeded                                          |\n\n# Webhooks\n\nThe webhook events documentation can be found by selecting `Webhooks - V1` in the [definitions](#definitions) select.\n\n"
  },
  "servers": [
    {
      "url": "https://app-sandbox.trustpair.com/"
    }
  ],
  "paths": {
    "/api/v1/company_account_audits/{id}/documents": {
      "get": {
        "summary": "Retrieve documents assigned to Company Account Audit",
        "tags": [
          "Documents"
        ],
        "description": "Retrieves a paginated list of documents associated with a specific Company Account Audit.\n\nThis endpoint allows you to:\n- List all documents linked to a company account audit\n- Include related resources (user)\n- Sort results by creation date\n- Paginate through large result sets\n\nResults are sorted by creation date (newest first) by default.\n\n**Required permissions:**\n- `documents_read`\n- `company_account_audits_read`\n\n**Note:** The document feature must be enabled for your account to access this endpoint.\n",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "description": "**Unique identifier** of the company account audit for which to retrieve\ndocuments. Must be a valid UUID format.\n",
            "example": "f66bfe26-4189-4e30-9606-2b53479a4d54"
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "fr"
              ]
            },
            "required": false,
            "description": "Specifies the preferred language for the response. Supported languages:\n* `en` - English\n* `fr` - French\n\nIf not provided, the default language will be used.\n",
            "example": "en"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            },
            "required": false,
            "description": "Maximum number of documents to return in the response.\n\n**Constraints:**\n* Minimum: 1\n* Maximum: 20\n\nIf not specified, the default pagination limit will be applied.\n",
            "example": 10
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "description": "**Pagination cursor** - returns documents created *after* the document\nwith this ID.\n\n* Results are ordered by creation date\n* Cannot be used together with `ending_before`\n* Must be a valid UUID\n",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          {
            "name": "ending_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "description": "**Pagination cursor** - returns documents created *before* the document\nwith this ID.\n\n* Results are ordered by creation date\n* Cannot be used together with `starting_after`\n* Must be a valid UUID\n",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "-created_at"
              ]
            },
            "required": false,
            "description": "Field and direction to sort results by.\n\n**Format:**\n* `created_at` - ascending order (oldest first)\n* `-created_at` - descending order (newest first)\n\n**Supported fields:** `created_at`\n",
            "example": "-created_at"
          },
          {
            "name": "include",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "user"
              ]
            },
            "required": false,
            "description": "Comma-separated list of related resources to include in the response.\n\nIncluding related resources reduces the need for additional API calls,\nbut increases response time and payload size.\n",
            "example": "user"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/document"
                      }
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "$ref": "#/components/schemas/user"
                          }
                        ]
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/links"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/meta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized response code",
            "content": {
              "application/json": {
                "examples": {
                  "With invalid token": {
                    "value": {
                      "message": "Bearer token invalid or missing"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden response code",
            "content": {
              "application/json": {
                "examples": {
                  "Without required permissions": {
                    "value": {
                      "message": "Access requires all permissions: 'documents_read', 'company_account_audits_read'"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity response code",
            "content": {
              "application/json": {
                "examples": {
                  "With limit that exceeds allowed number": {
                    "value": {
                      "message": "Limit must be less than or equal to 20",
                      "errors": [
                        {
                          "code": "less_than_or_equal_to",
                          "title": "must be less than or equal to 20",
                          "detail": "Limit must be less than or equal to 20",
                          "source": {
                            "parameter": "limit"
                          }
                        }
                      ]
                    }
                  },
                  "With limit that is below allowed number": {
                    "value": {
                      "message": "Limit must be greater than 0",
                      "errors": [
                        {
                          "code": "greater_than",
                          "title": "must be greater than 0",
                          "detail": "Limit must be greater than 0",
                          "source": {
                            "parameter": "limit"
                          }
                        }
                      ]
                    }
                  },
                  "With invalid sort": {
                    "value": {
                      "message": "Sort invalid value: foo and Sort invalid value: bar",
                      "errors": [
                        {
                          "code": "invalid_sort_field",
                          "title": "invalid value: foo",
                          "detail": "Sort invalid value: foo",
                          "source": {
                            "parameter": "sort"
                          }
                        },
                        {
                          "code": "invalid_sort_field",
                          "title": "invalid value: bar",
                          "detail": "Sort invalid value: bar",
                          "source": {
                            "parameter": "sort"
                          }
                        }
                      ]
                    }
                  },
                  "With invalid include": {
                    "value": {
                      "message": "Include is not included in the list",
                      "errors": [
                        {
                          "code": "inclusion",
                          "title": "is not included in the list",
                          "detail": "Include is not included in the list",
                          "source": {
                            "parameter": "include"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Documents",
      "description": "API endpoints for managing document attachments within your workspace.\nThese endpoints allow you to upload supporting documentation to your workspace, download existing documents, and associate documents with specific entities like cases, audits and checks.\nDocument management is crucial for maintaining evidence and audit trails for business decisions.\n"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "document": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "example": "trustpair/document",
            "enum": [
              "trustpair/document"
            ]
          },
          "id": {
            "type": "string",
            "example": "814a56f9-64d7-43e6-916a-b0bafe568a2b"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "file_name": {
                "type": "string",
                "example": "document.pdf"
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "example": "2025-05-10T13:12:56Z"
              }
            }
          },
          "relationships": {
            "type": "object",
            "properties": {
              "user": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "example": "trustpair/user",
                        "enum": [
                          "trustpair/user"
                        ]
                      },
                      "id": {
                        "type": "string",
                        "example": "4b9a21a1-c3e7-4635-8df2-5775a1603152"
                      }
                    }
                  }
                }
              }
            }
          },
          "links": {
            "type": "object",
            "properties": {
              "download": {
                "type": "string",
                "example": "https://trustpair.com/api/v1/documents/814a56f9-64d7-43e6-916a-b0bafe568a2b/download"
              }
            }
          }
        }
      },
      "user": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "trustpair/user"
            ]
          },
          "id": {
            "type": "string",
            "example": "4b9a21a1-c3e7-4635-8df2-5775a1603152"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "created_at": {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-10T12:34:56Z"
              },
              "last_name": {
                "type": "string",
                "example": "Doe"
              },
              "first_name": {
                "type": "string",
                "example": "John"
              },
              "full_name": {
                "type": "string",
                "example": "John Doe"
              },
              "email": {
                "type": "string",
                "format": "email",
                "example": "example@example.com"
              }
            }
          }
        }
      },
      "meta": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "example": 10
          },
          "total": {
            "type": "integer",
            "example": 122
          }
        }
      },
      "links": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "example": "https://trustpair.com/api/v1/resources?starting_after=4b9a21a1-c3e7-4635-8df2-5775a1603152"
          },
          "first": {
            "type": "string",
            "example": "https://trustpair.com/api/v1/resources"
          },
          "next": {
            "type": "string",
            "nullable": true,
            "example": "https://trustpair.com/api/v1/resources?starting_after=4b9a21a1-c3e7-4635-8df2-5775a1603152"
          },
          "prev": {
            "type": "string",
            "nullable": true,
            "example": "https://trustpair.com/api/v1/resources?ending_before=4b9a21a1-c3e7-4635-8df2-5775a1603152"
          }
        }
      }
    }
  }
}
```