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

# Assign document to company account audit

Assigns existing documents to company account audit.

**Required permissions:**
- `documents_write`
- `company_account_audits_write`


# 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/": {
      "post": {
        "summary": "Assign document to company account audit",
        "tags": [
          "Documents"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "description": "Assigns existing documents to company account audit.\n\n**Required permissions:**\n- `documents_write`\n- `company_account_audits_write`\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "description": "**Unique identifier** of the company account audit for which to assign\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": "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": {
          "201": {
            "description": "Document created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/document"
                      }
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "$ref": "#/components/schemas/user"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "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_write', 'company_account_audits_write'"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable content",
            "content": {
              "application/json": {
                "examples": {
                  "With invalid document id": {
                    "value": {
                      "message": "Document ids is invalid",
                      "errors": [
                        {
                          "code": "invalid",
                          "title": "is invalid",
                          "detail": "Document ids is invalid",
                          "source": {
                            "parameter": "document_ids"
                          }
                        }
                      ]
                    }
                  },
                  "With an out-of-base Company Account Audit": {
                    "value": {
                      "message": "Company account audit is out of base and can't be modified",
                      "errors": [
                        {
                          "code": "out_of_base",
                          "title": "is out of base and can't be modified",
                          "detail": "Company account audit is out of base and can't be modified",
                          "source": {
                            "parameter": "company_account_audit"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "description": "Root object containing the documents to assign",
                "properties": {
                  "data": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "8b71ee0e-525e-4713-9dcc-e749888ff994",
                          "description": "**Unique identifier** of the document.\n"
                        },
                        "type": {
                          "type": "string",
                          "example": "trustpair/document",
                          "enum": [
                            "trustpair/document"
                          ],
                          "description": "**Type** of the document.\n"
                        }
                      }
                    },
                    "minItems": 1
                  }
                }
              }
            }
          },
          "description": "The list of documents to assign to company account audit"
        }
      }
    }
  },
  "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"
              }
            }
          }
        }
      }
    }
  }
}
```