# Let an agent use a collection

`POST /workspace/memory/connect` · Rivier · memory

Let an agent use a collection.

- Scope: memory:write
- Graphql: Mutation.memoryCollectionConnect
- Sdk: memory.collection.connect
- Cli: memory collection connect

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "agentId": {
      "type": "string",
      "format": "uuid"
    },
    "collectionId": {
      "type": "string",
      "format": "uuid"
    }
  },
  "required": [
    "agentId",
    "collectionId"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/workspace/memory/connect' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "agentId": "string",
  "collectionId": "string"
}'
```
