> ## Documentation Index
> Fetch the complete documentation index at: https://alphacastio.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /repositories — Create a Repository

> Create a new repository to organize datasets. Requires name and privacy. Optionally specify description and team for collaboration.

Repositories are the top-level containers for organizing your datasets on Alphacast. Use this endpoint to create a new repository under your account. You will automatically become the `Owner` of any repository you create.

## Request

```bash theme={null}
POST https://api.alphacast.io/repositories
```

Send a JSON body with the `Content-Type: application/json` header.

## Authentication

<Note>
  This endpoint requires HTTP Basic Auth. Pass your API key as the username and leave the password empty.
</Note>

## Body parameters

<ParamField body="name" type="string" required>
  Display name for the new repository.
</ParamField>

<ParamField body="privacy" type="string" required>
  Visibility setting for the repository. Must be either `"Public"` or `"Private"`.
</ParamField>

<ParamField body="description" type="string">
  Optional description of the repository's contents or purpose.
</ParamField>

<ParamField body="team" type="string">
  Optional team name to associate this repository with for collaborative access.
</ParamField>

## Response

Returns `201 Created` with the newly created repository object.

<ResponseField name="id" type="integer">
  Unique numeric identifier assigned to the new repository.
</ResponseField>

<ResponseField name="name" type="string">
  Display name of the repository.
</ResponseField>

<ResponseField name="description" type="string">
  Description of the repository, if provided.
</ResponseField>

<ResponseField name="privacy" type="string">
  Visibility setting. Either `"Public"` or `"Private"`.
</ResponseField>

<ResponseField name="team" type="string">
  The team this repository belongs to, if provided.
</ResponseField>

<ResponseField name="permission" type="string">
  Your access level. Always `"Owner"` for repositories you create.
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl -u YOUR_API_KEY: \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Emerging Markets Macro",
      "description": "GDP, inflation, and rates for EM economies",
      "privacy": "Private",
      "team": "research"
    }' \
    https://api.alphacast.io/repositories
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.alphacast.io/repositories",
      auth=("YOUR_API_KEY", ""),
      json={
          "name": "Emerging Markets Macro",
          "description": "GDP, inflation, and rates for EM economies",
          "privacy": "Private",
          "team": "research",
      },
  )
  repository = response.json()
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.alphacast.io/repositories", {
    method: "POST",
    headers: {
      Authorization: "Basic " + btoa("YOUR_API_KEY:"),
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "Emerging Markets Macro",
      description: "GDP, inflation, and rates for EM economies",
      privacy: "Private",
      team: "research",
    }),
  });
  const repository = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": 101,
    "name": "Emerging Markets Macro",
    "description": "GDP, inflation, and rates for EM economies",
    "privacy": "Private",
    "team": "research",
    "permission": "Owner"
  }
  ```
</ResponseExample>
