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

# Create

> Create a proxied service



## OpenAPI

````yaml POST /api/v1/proxied-services
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/proxied-services:
    post:
      tags:
        - Proxied Services
      description: Create a proxied service
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  minLength: 1
                  description: The ID of the project to create the proxied service in.
                environment:
                  type: string
                  minLength: 1
                  description: >-
                    The slug of the environment to create the proxied service
                    in.
                secretPath:
                  type: string
                  default: /
                  description: The secret path (folder) to create the proxied service in.
                name:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: The name of the proxied service.
                hostPattern:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    One or more comma-separated host patterns the service
                    applies to, e.g. 'api.stripe.com, *.stripe.com'. Each
                    pattern is host[:port][/path]; a '*.' wildcard matches
                    exactly one label.
                isEnabled:
                  type: boolean
                  description: >-
                    Whether the proxied service is enabled. The agent proxy
                    skips disabled services.
                credentials:
                  type: array
                  items:
                    type: object
                    properties:
                      secretKey:
                        type: string
                        minLength: 1
                        maxLength: 255
                        description: >-
                          The key name of the referenced secret. The secret must
                          live in the same folder as the service.
                      role:
                        type: string
                        enum:
                          - header-rewrite
                          - credential-substitution
                        description: >-
                          How the credential is applied: 'header-rewrite' sets
                          an HTTP header on the outbound request;
                          'credential-substitution' replaces a placeholder value
                          in the request.
                      headerName:
                        type: string
                        minLength: 1
                        maxLength: 255
                        description: >-
                          For header rewriting: the header to set, e.g.
                          'Authorization' or 'x-api-key'.
                      headerPrefix:
                        type: string
                        maxLength: 255
                        description: >-
                          For header rewriting: an optional prefix joined to the
                          secret value with a space, e.g. 'Bearer'.
                      headerPurpose:
                        type: string
                        enum:
                          - username
                          - password
                        description: >-
                          For HTTP basic auth: 'username' or 'password'. The
                          agent proxy combines the pair into a single
                          'Authorization: Basic' header. Cannot be combined with
                          headerName or headerPrefix.
                      placeholderKey:
                        type: string
                        minLength: 1
                        maxLength: 255
                        description: >-
                          For credential substitution: the environment variable
                          name the agent receives.
                      placeholderValue:
                        type: string
                        minLength: 1
                        maxLength: 255
                        description: >-
                          For credential substitution: the placeholder value the
                          agent proxy swaps for the real secret value on the
                          wire.
                      substitutionSurfaces:
                        type: array
                        items:
                          type: string
                          enum:
                            - header
                            - path
                            - query
                            - body
                        minItems: 1
                        description: >-
                          For credential substitution: which request surfaces
                          are scanned for the placeholder. Allowed values:
                          'header', 'path', 'query', 'body'.
                    required:
                      - secretKey
                      - role
                    additionalProperties: false
                  minItems: 1
                  description: >-
                    The credentials the agent proxy applies to requests matching
                    the host pattern.
              required:
                - projectId
                - environment
                - name
                - hostPattern
                - credentials
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  service:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      hostPattern:
                        type: string
                      isEnabled:
                        type: boolean
                        default: true
                      folderId:
                        type: string
                        format: uuid
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      credentials:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                            serviceId:
                              type: string
                              format: uuid
                            secretKey:
                              type: string
                            role:
                              type: string
                            headerName:
                              type: string
                              nullable: true
                            headerPrefix:
                              type: string
                              nullable: true
                            headerPurpose:
                              type: string
                              nullable: true
                            placeholderKey:
                              type: string
                              nullable: true
                            placeholderValue:
                              type: string
                              nullable: true
                            substitutionSurfaces:
                              type: array
                              items:
                                type: string
                              nullable: true
                          required:
                            - id
                            - serviceId
                            - secretKey
                            - role
                          additionalProperties: false
                    required:
                      - id
                      - name
                      - hostPattern
                      - folderId
                      - createdAt
                      - updatedAt
                      - credentials
                    additionalProperties: false
                required:
                  - service
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````