> For the complete documentation index, see [llms.txt](https://docs.cange.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cange.me/api/arquivos/adicionar-um-arquivo.md).

# Adicionar um arquivo

A inserção de arquivos no Cange começa pela criação de um objeto de arquivo no repositório central da plataforma. Esse repositório funciona como uma base única de documentos, garantindo que cada arquivo tenha um ID próprio, controle de acesso e trilha de auditoria. Assim que o objeto é criado, o Cange gera automaticamente um código de vinculação, permitindo relacionar o arquivo a qualquer outro recurso — cartões, registros de processos, etapas de aprovação ou dashboards.

Para buscar um arquivo através da API, você precisará ter um token de acesso. Se ainda não possui o seu token, consulte nosso guia abaixo sobre como obter o token de autenticação.

{% content-ref url="/pages/9WZ3PW4K1WSS8OpsOrjm" %}
[Autenticação](/api/autenticacao.md)
{% endcontent-ref %}

## Realizando a chamada para adicionar um arquivo

```http
https://api.cange.me/attachment
```

<mark style="color:green;">`POST`</mark> `/attachment`

Endpoint com o objetivo de inserir um arquivo e retornar o id\_attachment criado

**Headers**

| Name          | Value                      |
| ------------- | -------------------------- |
| Content-Type  | `multipart/form-data`      |
| Origin        | `https://app.cange.me`     |
| Authorization | `Bearer <token de acesso>` |

**Multipart**

| Name | Value   |
| ---- | ------- |
| file | \<File> |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "attachment_container_id": 3342,
    "hash": "0735e7051d8a84d55468ca263917cbffb1ee7fe3-logo.png",
    "original_name": "logo.png",
    "mime_type": "image/png",
    "url": "https://cangeblob...",
    "blob_size": 175.8740234375,
    "dt_created": "2025-05-18T23:19:23.000Z",
    "dt_last_update": "2025-05-18T23:19:23.000Z",
    "user_id": 76,
    "id_attachment": 150206
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cange.me/api/arquivos/adicionar-um-arquivo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
