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

# Crear un repositorio

> Elija nombre, mutabilidad de etiquetas, protección contra eliminación y etiquetas de recurso.

Cree un repositorio en la cuenta y región seleccionadas. Los nombres pueden incluir un namespace, como `team/api`. Defina `tag_mutability` como `immutable` cuando una etiqueta no deba sustituirse y active `deletion_protection` para evitar eliminaciones accidentales.

<Tabs>
  <Tab title="Console">
    1. Abra [Repositorios](https://console.basaltic.sh/registry/repositories) en la cuenta y región seleccionadas.
    2. Seleccione **Create repository** para abrir el formulario e indique un **Name**, como `team/api`.
    3. Active **Immutable tags** para impedir cambios en etiquetas existentes.
    4. Active **Deletion protection** para proteger contra eliminaciones accidentales.
    5. Seleccione **Create repository** y use la URI devuelta al enviar imágenes.
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl --fail-with-body --request POST \
      https://registry.sa-saopaulo-1.basaltic.sh/v1/repositories \
      --header "Authorization: Bearer $TOKEN" \
      --header "X-Account-Id: $ACCOUNT" \
      --header 'Content-Type: application/json' \
      --data '{"name":"team/api","tag_mutability":"immutable","deletion_protection":true}'
    ```
  </Tab>

  <Tab title="CLI">
    Guarde la solicitud JSON de la pestaña API como `request-1.json`. Use su cuenta y región configuradas.

    ```bash theme={null}
    basaltic registry repository create --from-file request-1.json
    ```
  </Tab>

  <Tab title="Go">
    Guarde la solicitud JSON de la pestaña API como `request-1.json`. Configure credenciales, cuenta y región mediante las variables de entorno del SDK.

    ```go theme={null}
    package main

    import (
    	"context"
    	"encoding/json"
    	"fmt"
    	"os"

    	basaltic "github.com/basaltic-sh/sdk-go"
    	"github.com/basaltic-sh/sdk-go/registry"
    )

    func readJSON(path string, value any) error {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		return err
    	}
    	return json.Unmarshal(data, value)
    }

    func run() error {
    	ctx := context.Background()
    	cfg, err := basaltic.NewConfig(ctx)
    	if err != nil {
    		return err
    	}
    	client := registry.New(cfg)
    	var request1 registry.CreateRepositoryRequest
    	if err := readJSON("request-1.json", &request1); err != nil {
    		return err
    	}
    	result1, err := client.CreateRepository(ctx, &request1)
    	if err != nil {
    		return err
    	}
    	fmt.Printf("%+v\n", result1)
    	return nil
    }

    func main() {
    	if err := run(); err != nil {
    		fmt.Fprintln(os.Stderr, err)
    		os.Exit(1)
    	}
    }
    ```
  </Tab>
</Tabs>

La respuesta contiene `repository.id` para administración y `repository.uri` para referencias de imagen. Conceda acciones de push a la identidad de compilación y solo acciones de pull a las identidades de ejecución, según [Permisos](/es/registry/permissions).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.