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

# Create a new environment

> Creates a new environment for a merchant and generates an API key.



## OpenAPI

````yaml post /api/v1/environments/
openapi: 3.0.3
info:
  title: Superpool API
  version: 2.0.0
  description: >-
    Insurance infrastructure for Financial Institutions, Insurers, and
    Insurtechs
  contact:
    name: Unyte Africa LTD.
    url: https://ng.unyte.africa
    email: tech@unyte.com
servers: []
security: []
paths:
  /api/v1/environments/:
    post:
      tags:
        - Environments
      summary: Create a new environment
      description: Creates a new environment for a merchant and generates an API key.
      operationId: v1_environments_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EnvironmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EnvironmentCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentResponse'
              examples:
                SuccessResponseExample:
                  value:
                    environment_id: 64e6eb79-b9f7-4e3a-96e1-0baee17acd5f
                    environment_name: Development Environment
                    test_mode: true
                    raw_api_key: your-raw-api-key-here
                  summary: Success Response Example
          description: Environment successfully created
        '400':
          description: Validation errors
        '401':
          description: Unauthorized
      security:
        - ClientKeyAuth: []
components:
  schemas:
    EnvironmentCreate:
      type: object
      description: Serializes the information of an environment
      properties:
        merchant_tenant_id:
          type: string
          format: uuid
        environment_name:
          type: string
          maxLength: 255
        test_mode:
          type: boolean
      required:
        - environment_name
        - merchant_tenant_id
        - test_mode
    EnvironmentResponse:
      type: object
      properties:
        environment_name:
          type: string
        test_mode:
          type: boolean
        client_id:
          type: string
          format: uuid
        raw_key:
          type: string
      required:
        - client_id
        - environment_name
        - raw_key
        - test_mode
  securitySchemes:
    ClientKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````