# Create a repository `POST /distribution/v1/repositories` Create a repository for an organization, seeded with the Luma scaffold. ## Request example ```bash curl --request POST \ --url 'https://api.eu1.luigisbox.ai/distribution/v1/repositories' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "channel_id": "example", "channel_name": "example", "name": "example", "organization_id": "example" }' ``` ## Request Body **Required.** ### application/json Schema: `object` #### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `channel_id` | `anyOf(string, null)` | No | Channel the seeded integration reads, e.g. `lbn_4hj9tv`. Omitted means the channel is not known yet; the integration keeps Luma switched off until one is set. | — | | `channel_name` | `anyOf(string, null)` | No | The channel's name, usually the site's domain. Recorded in the seeded `AGENTS.md`. | — | | `name` | `anyOf(string, null)` | No | Display name. Trimmed, 1–200 characters. | — | | `organization_id` | `string` | Yes | Organization that will own the repository, e.g. `lbo_r2vn8c`. | — | #### Request body example ```json { "channel_id": "example", "channel_name": "example", "name": "example", "organization_id": "example" } ``` ## Responses | Status | Description | Content | |---|---|---| | `201` | Successful Response | application/json: object | | `401` | Missing or invalid credentials | application/json: object | | `403` | Authenticated but not permitted | application/json: object | | `422` | Request validation failed | application/json: object | | `502` | Upstream service failed | application/json: object | ### 201 Successful Response #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `created_at` | `string` | Yes | When the repository was created. | format: date-time | | `git_url` | `string` | Yes | Clone and push URL for `git`. | — | | `loader_script_url` | `string` | Yes | Public URL of the loader script. Published by the first push — it answers 404 until then. | — | | `name` | `anyOf(string, null)` | No | Display name, or `null` when none was set. | — | | `organization_id` | `string` | Yes | Organization that owns the repository, e.g. `lbo_r2vn8c`. | — | | `repository_id` | `string` | Yes | Assigned repository id, e.g. `lbdr_8w3k2p`. | — | | `state` | `string` | Yes | Whether the repository is ready to be used. `active` is the only state it can be cloned or pushed to in; `provisioning` and `deleting` mean a create or a delete did not finish. | allowed values: provisioning, active, deleting | | `updated_at` | `string` | Yes | When the repository's metadata last changed. | format: date-time | ##### Response example ```json { "created_at": "2026-04-15T12:00:00Z", "git_url": "example", "loader_script_url": "example", "name": "example", "organization_id": "example", "repository_id": "example", "state": "provisioning", "updated_at": "2026-04-15T12:00:00Z" } ``` ### 401 Missing or invalid credentials #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 403 Authenticated but not permitted #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 422 Request validation failed #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 502 Upstream service failed #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ```