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

# Create a project

> Creates a project with its data configuration in one transaction; if any part fails, nothing is created. The token's user, if it has one, becomes the project owner. A token limited to a supplier or customer gets 403. Requires the `write:project` token scope.



## OpenAPI

````yaml POST /projects
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
  description: >
    ## Limited tokens


    A token whose user is limited to a supplier reaches only that supplier's
    projects and their records; a user limited to a customer reaches no
    projects. Other projects' records behave as if they don't exist: a lookup
    returns 404, a list omits them, and a request body that references them is
    rejected. Such a token can't create projects. It can read account-wide
    custom field definitions but can't create or change any definition. An asset
    belongs to its project and to every project that uses its location; the
    token sees an asset when one of those projects is its own. It gets 403 when
    it changes or deletes a location that a project outside its reach also uses,
    or creates, moves, changes or deletes an asset that belongs to such a
    project. Such an asset's `project_id` can name a project the token can't
    open. Orders, whose deliveries span the account's projects, are hidden.


    ## Filtering and sorting


    List endpoints that accept `filter` take one query parameter per condition,
    written `filter[field][comparator]=value`, for example
    `filter[name][contains]=North`. The comparators are `eq`, `neq`, `gt`,
    `geq`, `lt`, `leq` and `contains`, and `filter[field]=value` is short for
    `eq`. Conditions combine with AND. `contains` matches part of the value, is
    case-sensitive, and applies only to text fields. An unknown field or
    comparator, a value that doesn't fit the field's type, or a list or object
    as the value returns 400 with a message naming the problem. Each list
    operation names its filterable fields; some take only `eq`, and say so.


    `sort` takes a comma-separated list of fields, for example
    `sort=-created_at,name`. Each field sorts ascending, or descending with a
    `-` prefix. Unknown sort fields are ignored. Sorting by `id` orders by the
    record's internal ID, not its friendly ID. Each list operation names its
    sortable fields.


    ## Timeouts


    Any endpoint can answer 503 with code `deadline_exceeded` when a request
    runs out of time. Retry a read once; if it times out again, narrow it with a
    shorter date range or more filters. A write may have completed before the
    timeout, so check its result before retrying it.


    ## Allowed networks


    An account admin can limit the networks API tokens may be used from. When an
    account has such a list, a request from any other network answers 403 with
    code `network_not_allowed`, and the message names the address Mangrove saw
    so you can ask an admin to add it. A request whose address Mangrove cannot
    verify answers 403 with code `client_address_unverified`. The list applies
    to every token that authenticates as the account, including supplier and
    customer tokens. Accounts without a list are not affected.
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /projects:
    post:
      summary: Create a project
      description: >-
        Creates a project with its data configuration in one transaction; if any
        part fails, nothing is created. The token's user, if it has one, becomes
        the project owner. A token limited to a supplier or customer gets 403.
        Requires the `write:project` token scope.
      operationId: create-project
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - project
              properties:
                project:
                  type: object
                  required:
                    - name
                    - project_status
                  properties:
                    name:
                      type: string
                      description: Name of the project
                    project_status:
                      type: string
                      description: >-
                        Name of one of the account's project statuses, matched
                        case-insensitively. An unknown name gets a 422 listing
                        the account's statuses.
                    description:
                      type:
                        - string
                        - 'null'
                      description: >-
                        Description of the project. `null` is treated as
                        omitted.
                    start_date:
                      type:
                        - string
                        - 'null'
                      format: date
                      description: >-
                        Start date of the project. Stored but not returned in
                        the response. `null` is treated as omitted.
                    location:
                      type:
                        - array
                        - 'null'
                      items:
                        type: string
                      description: >-
                        Region path from the app's location picker, a continent
                        or country followed by a state or province where the app
                        offers one, e.g. `["USA", "CA"]`. Stored as given. Not
                        returned; the response's `country` and `state` come from
                        the project's primary location. `null` is treated as
                        omitted.
                    field_values:
                      type:
                        - object
                        - 'null'
                      description: >-
                        Custom field values for the project, keyed by custom
                        field definition `key`. Each key must match a project
                        custom field definition, and the account's required
                        custom fields apply. `null` is treated as omitted.
                      additionalProperties: true
            examples:
              Request Example:
                value:
                  project:
                    name: North Plant
                    project_status: Draft
                    description: Biochar production at the north site
                    start_date: '2026-01-01'
                    location:
                      - USA
                      - CA
      responses:
        '201':
          description: The created project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDetail'
        '400':
          $ref: '#/components/responses/MissingParameter'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The token lacks the `write:project` scope, or its user is limited to
            a supplier or customer.
          content:
            application/json:
              examples:
                Missing scope or limited token:
                  value:
                    errors:
                      - message: You are not authorized to perform this action
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Project validation errors carry `field` and `code`, as in
            ValidationFailed. Unknown status and malformed fields are
            message-only.
          content:
            application/json:
              examples:
                Unknown status:
                  value:
                    errors:
                      - message: 'project_status must be one of: Active, Draft'
                Blank name:
                  value:
                    errors:
                      - message: Name can't be blank
                        field: name
                        code: blank
                Malformed fields:
                  value:
                    errors:
                      - message: 'Unsupported or malformed project fields: location'
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ProjectDetail:
      description: >-
        A single project, with its custom fields resolved and a link into the
        app.
      allOf:
        - $ref: '#/components/schemas/Project'
        - type: object
          properties:
            custom_fields:
              type: array
              description: >-
                One entry per custom field definition that applies to the
                project, whether or not it has a value.
              items:
                $ref: '#/components/schemas/ProjectCustomField'
            ui_url:
              type: string
              format: uri
              description: Link that opens this project in the Mangrove app.
              example: https://app.gomangrove.com/nexus/prj_aBcD1234eFgH5678
    ErrorResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - message
            properties:
              message:
                type: string
                description: Human-readable error message
              field:
                type: string
                description: Attribute the error applies to (validation errors only)
              code:
                type: string
                description: >-
                  Machine-readable error code — the validation rule a field
                  broke, or why an operation refused. An operation's responses
                  list the refusal codes it can return.
              blocking:
                type: array
                description: >-
                  Bounded preview of the records blocking a destroy
                  (blocked-destroy errors only)
                items:
                  $ref: '#/components/schemas/DeletionBlockingRecord'
              blocking_count:
                type: integer
                description: >-
                  Total count of records blocking a destroy (blocked-destroy
                  errors only)
              config_key:
                type: string
                description: >-
                  The data feed source config setting to fix, when the error is
                  on `config` (data feed source validation errors only)
              count:
                type: number
                description: >-
                  The limit or comparison value the failed validation checked
                  against, e.g. a maximum length or a numeric bound (validation
                  errors only, when the validation has one)
              value:
                description: >-
                  The rejected value, e.g. on an inclusion or uniqueness failure
                  (validation errors only, when the validation reports one)
    Project:
      type: object
      description: A project as it appears in list rows.
      properties:
        id:
          type: string
          description: The project's friendly ID (e.g. `prj_aBcD1234eFgH5678`).
          example: prj_aBcD1234eFgH5678
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        project_type:
          type:
            - string
            - 'null'
        credit_types:
          type: array
          items:
            type: string
        country:
          type:
            - string
            - 'null'
          description: Country of the project's primary location's address.
        state:
          type:
            - string
            - 'null'
          description: State of the project's primary location's address.
        project_status:
          type:
            - string
            - 'null'
        registry_id:
          type:
            - integer
            - 'null'
          description: Numeric ID of the project's registry.
        registry_name:
          type:
            - string
            - 'null'
        registry_link:
          type:
            - string
            - 'null'
        methodology:
          type:
            - string
            - 'null'
        inventory:
          $ref: '#/components/schemas/ProjectInventory'
        images:
          type: array
          items:
            $ref: '#/components/schemas/ProjectImage'
        sustainable_development_goals:
          type: array
          items:
            type: string
        field_values:
          type: object
          additionalProperties: true
          description: Custom field values keyed by custom field definition `key`.
    ProjectCustomField:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        variant:
          type: string
          enum:
            - text
            - number
            - boolean
            - date
            - enum
            - url
          description: The definition's `value_type`, with `string` reported as `text`.
        value:
          description: The project's value for this field, or null when unset.
        enumeration_options:
          type:
            - array
            - 'null'
          items:
            type: string
          description: The allowed values when `variant` is `enum`; null otherwise.
    DeletionBlockingRecord:
      type: object
      required:
        - type
      properties:
        type:
          type: string
        friendly_id:
          type: string
        name:
          type:
            - string
            - 'null'
          description: >-
            Display label, and the only identifier for records that have no
            friendly_id
    ProjectInventory:
      type: object
      description: >-
        Available credit balances from active issuances, split into spot
        (issued) and forecast. Each period and total carries a `total` plus one
        key per credit type name.
      properties:
        spot:
          type: array
          items:
            $ref: '#/components/schemas/ProjectInventoryPeriod'
        forecasts:
          type: array
          items:
            $ref: '#/components/schemas/ProjectInventoryPeriod'
        spot_total:
          $ref: '#/components/schemas/ProjectInventoryTotal'
        forecast_total:
          $ref: '#/components/schemas/ProjectInventoryTotal'
        total:
          $ref: '#/components/schemas/ProjectInventoryTotal'
    ProjectImage:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        url:
          type: string
          format: uri
    ProjectInventoryPeriod:
      type: object
      properties:
        period:
          type: integer
          description: Year.
        total:
          type: number
      additionalProperties:
        type: number
    ProjectInventoryTotal:
      type: object
      properties:
        total:
          type: number
      additionalProperties:
        type: number
  responses:
    MissingParameter:
      description: >-
        A required parameter or body object is missing or empty. The message
        names it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - message: 'param is missing or the value is empty or invalid: project'
    Unauthorized:
      description: >-
        The API token is missing, invalid or expired. The body is empty, except
        for an expired token, which returns the error below.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - message: API token has expired
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````

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