---
title: "Attach Repository"
method: POST
path: "/api/v1/repository-attachments"
tags: ["authed"]
---

# Attach Repository

`POST /api/v1/repository-attachments`

## Request

- Base URL: `https://api.teaflask.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.teaflask.com/api/v1/repository-attachments`
- Auth: none declared

Attach one of the caller's org's connected repositories to one of
the caller's own conversations. assistant.use is the matching tier
(the action acts as the member, from inside a conversation) — every
role holds it today, so the dependency is the call-site law kept
honest, while the RLS-scoped connection read below stays the
authority on what may be named.

## Request body

- AttachRepositoryRequest
  - `thread_id` string, uuid, required
  - `repository` string, required

## Response `200`

Successful Response

- AttachRepositoryResponse
  - `repository` string, required
  - `pinned_sha` string, required
  - `status` 'attached', required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `409`: The repository is already attached to this conversation, or another attachment to it is still materializing
- `422`: Validation error
- `500`: Internal server error
- `502`: The attachment could not resolve its pin; the consent record stands and retries or later turns keep retrying it
- `503`: Orchestration unavailable

## Changes

- **2026-11-03** `c6ac9fd6657f`: 9 info
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `401`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `403`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `404`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `405`
  - …5 more

[Operation history](https://skmtc.dev/teaflask/apis/teaflask-api/changes/api/v1/repository-attachments/post.md)

---

[API](https://skmtc.dev/teaflask/apis/teaflask-api.md) - [All operations](https://skmtc.dev/teaflask/apis/teaflask-api/llms.txt) - [OpenAPI document](https://skmtc.dev/teaflask/apis/teaflask-api/revisions/c6ac9fd6657f?raw)
