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

# Criar projeto

> Um projeto novo, que nasce com os espaços de sandbox e produção.



## OpenAPI

````yaml openapi/pt/control.json POST /v1/projects
openapi: 3.1.0
info:
  title: API de controle da Niadra
  version: '1'
  description: >-
    Tenants, projetos, fontes, chaves, pessoas, configuração e uso. Nunca recebe
    conteúdo de cliente.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/projects:
    post:
      summary: Criar projeto
      description: >-
        Cria um projeto na região informada, uma das regiões do seu contrato.
        Ele nasce com dois espaços, sandbox e produção, que nunca compartilham
        dados. Exige o papel admin.


        **Autenticação.** Token de pessoa emitido pelo controle (`Authorization:
        Bearer <JWT>`), com o papel que a operação pede.
      operationId: create_project_v1_projects_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectCreate'
            example:
              name: Support
              slug: support
              region: us-east-1
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectOut'
              example:
                project_id: 0192f0a0-2c3d-7e4f-9a50-6b7c8d9e0f12
                name: Support
                slug: support
                region: us-east-1
                spaces:
                  - space_id: 0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23
                    project_id: 0192f0a0-2c3d-7e4f-9a50-6b7c8d9e0f12
                    environment: production
                    slug: acme-prod
                    region: us-east-1
                    cell_id: cell-1
                  - space_id: 0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a24
                    project_id: 0192f0a0-2c3d-7e4f-9a50-6b7c8d9e0f12
                    environment: sandbox
                    slug: acme-sandbox
                    region: us-east-1
                    cell_id: cell-1
          description: O projeto e os dois espaços dele.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security:
        - personToken: []
components:
  schemas:
    ProjectCreate:
      additionalProperties: false
      properties:
        name:
          maxLength: 256
          minLength: 1
          title: Name
          type: string
        region:
          pattern: ^[a-z]{2}(-[a-z]+)+-\d{1,2}$
          title: Region
          type: string
        slug:
          pattern: ^[a-z][a-z0-9-]{1,30}[a-z0-9]$
          title: Slug
          type: string
      required:
        - name
        - slug
        - region
      title: ProjectCreate
      type: object
    ProjectOut:
      additionalProperties: false
      properties:
        name:
          title: Name
          type: string
        project_id:
          format: uuid
          title: Project Id
          type: string
        region:
          title: Region
          type: string
        slug:
          title: Slug
          type: string
        spaces:
          items:
            $ref: '#/components/schemas/SpaceOut'
          title: Spaces
          type: array
      required:
        - project_id
        - name
        - slug
        - region
        - spaces
      title: ProjectOut
      type: object
    Problem:
      additionalProperties: false
      description: >-
        Detalhes do problema no formato da RFC 9457; `code` vem do catálogo de
        erros versionado.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    SpaceOut:
      additionalProperties: false
      properties:
        cell_id:
          title: Cell Id
          type: string
        environment:
          $ref: '#/components/schemas/Environment'
        project_id:
          format: uuid
          title: Project Id
          type: string
        region:
          title: Region
          type: string
        slug:
          title: Slug
          type: string
        space_id:
          format: uuid
          title: Space Id
          type: string
      required:
        - space_id
        - project_id
        - environment
        - slug
        - region
        - cell_id
      title: SpaceOut
      type: object
    Environment:
      enum:
        - sandbox
        - production
      title: Environment
      type: string
  securitySchemes:
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````