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

# Set Environment for a Service

> Sets the environment type for the service.



## OpenAPI

````yaml /api-reference/tiger-cloud-rest-api/openapi.yaml post /projects/{project_id}/services/{service_id}/setEnvironment
openapi: 3.0.3
info:
  title: Tiger Cloud API
  description: |
    A RESTful API for Tiger Cloud.
  version: 1.0.0
  license:
    name: Proprietary
    url: https://www.tigerdata.com/legal/terms
  contact:
    name: Tiger Data Support
    url: https://www.tigerdata.com/contact
servers:
  - url: https://console.cloud.timescale.com/public/api/v1
    description: API server for Tiger Cloud
  - url: http://localhost:8080
    description: Local development server
security:
  - basicAuth: []
tags:
  - name: Auth
    description: Authentication and authorization information.
  - name: VPCs
    description: Manage VPCs and their peering connections.
  - name: Services
    description: Manage services, read replicas, and their associated actions.
  - name: Analytics
    description: Track analytics events.
paths:
  /projects/{project_id}/services/{service_id}/setEnvironment:
    post:
      tags:
        - Services
      summary: Set Environment for a Service
      description: Sets the environment type for the service.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/ServiceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetEnvironmentInput'
      responses:
        '200':
          $ref: '#/components/responses/SuccessMessage'
        4XX:
          $ref: '#/components/responses/ClientError'
components:
  parameters:
    ProjectId:
      name: project_id
      in: path
      required: true
      description: The unique identifier of the project.
      schema:
        type: string
        example: rp1pz7uyae
    ServiceId:
      name: service_id
      in: path
      required: true
      description: The unique identifier of the service.
      schema:
        type: string
        example: d1k5vk7hf2
  schemas:
    SetEnvironmentInput:
      type: object
      required:
        - environment
      properties:
        environment:
          type: string
          description: The target environment for the service.
          enum:
            - PROD
            - DEV
      example:
        environment: PROD
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  responses:
    SuccessMessage:
      description: The action was completed successfully.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Action completed successfully.
    ClientError:
      description: Client error response (4xx status codes).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >
        HTTP Basic Authentication using your Tiger Cloud public key and secret
        key.


        Format: `Authorization: Basic <base64(public_key:secret_key)>`


        Example:

        ```bash

        curl -X GET
        "https://console.cloud.timescale.com/public/api/v1/projects/{project_id}/services"
        \
          -H "Authorization: Basic $(echo -n 'your_public_key:your_secret_key' | base64)"
        ```

````