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

# Create Service

> Create a VPS service or submit a service request for approval.

Create a VPS service for a client. You can request automatic approval or submit the request for manual approval.

## Behavior

When `auto_approve` is `true`, the API starts service provisioning immediately.

When `auto_approve` is `false`, the API creates a pending service request and alerts your eligible staff members for review. Service provisioning happens only if the service request is approved manually.

## Responses

A request can return HTTP `200` or HTTP `202`.

### Automatic Approval

When automatic approval succeeds, the endpoint returns HTTP `200`.

### Manual Approval

When `auto_approve` is `false`, the endpoint creates a pending service request and returns HTTP `202`.

### Processing And Review

The endpoint returns HTTP `202` when processing is still in progress or when a setup problem needs further review from NYCServers. In this situation the submission should be treated as submitted, and a re-try is not needed.

## Errors

All error responses have `success: false` and an `error` object.

| HTTP status | Error code                 | Cause                                                                                        |
| ----------- | -------------------------- | -------------------------------------------------------------------------------------------- |
| `400`       | `invalid_request`          | The body is not valid JSON, or a field has the wrong type.                                   |
| `400`       | `missing_parameter`        | `client_name`, `client_email`, or `plan` is missing or empty.                                |
| `400`       | `invalid_parameter`        | The email, plan, or language is not valid.                                                   |
| `401`       | `authentication_failed`    | The Bearer token is missing, invalid, inactive, or expired.                                  |
| `403`       | `insufficient_permissions` | The request IP is not allowed, or the key does not have a required scope.                    |
| `429`       | `rate_limit_exceeded`      | The key has reached its rate limit. The `Retry-After` header gives the wait time in seconds. |
| `500`       | `server_error`             | The request, authentication, or provisioning workflow could not complete.                    |


## OpenAPI

````yaml api/openapi.yaml POST /v1/service-create
openapi: 3.1.0
info:
  title: Broker API
  version: 1.0.0
  description: API for broker-scoped service, request, and report operations.
servers:
  - url: https://brokers.newyorkcityservers.com/api
    description: Broker Panel API
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Services
  - name: Requests
  - name: Reports
paths:
  /v1/service-create:
    post:
      tags:
        - Services
      summary: Create Service
      description: >-
        Creates a VPS service or submits one for approval. Requires
        `services:write` or `admin:full`.
      operationId: createService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceCreateRequest'
            example:
              client_name: John Doe
              client_email: john@example.com
              plan: standard-vps
              vps_language: english
              auto_approve: true
              trading_account_number: ACC123456
              notes: Create this service for the London desk.
      responses:
        '200':
          description: Service created.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        $ref: '#/components/schemas/ServiceCreateResult'
              example:
                success: true
                data:
                  service_number: 971100321
                  request_id: REQ-000321
                  created_date: '2026-06-23T12:00:00.000Z'
        '202':
          description: >-
            Request accepted for manual approval, still processing, or escalated
            for review.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        $ref: '#/components/schemas/ReviewResult'
              examples:
                pending:
                  value:
                    success: true
                    data:
                      request_id: REQ-000124
                      request_status: pending
                      message: Service request submitted for approval
                review:
                  value:
                    success: true
                    data:
                      request_id: REQ-000124
                      request_status: nycservers_review
                      message: >-
                        There was a setup issue. Your request is now under admin
                        review—no need to resubmit. The service will be
                        delivered to the client shortly.
                      service_number: 971100321
                      service_status: pending
        '400':
          description: >-
            Codes `invalid_request`, `missing_parameter`, or
            `invalid_parameter`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingFields:
                  value:
                    success: false
                    error:
                      code: missing_parameter
                      message: Missing required fields
                      details:
                        required_fields:
                          - client_name
                          - client_email
                          - plan
                invalidPlan:
                  value:
                    success: false
                    error:
                      code: invalid_parameter
                      message: Invalid plan
                      details:
                        valid_values:
                          - basic-vps
                          - standard-vps
                          - professional-vps
                          - dedicated-server
                        accepted_labels:
                          - Basic VPS
                          - Standard VPS
                          - Professional VPS
                          - Dedicated Server
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '403':
          $ref: '#/components/responses/PermissionError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ServiceCreateRequest:
      type: object
      required:
        - client_name
        - client_email
        - plan
      additionalProperties: true
      properties:
        client_name:
          type: string
          minLength: 1
        client_email:
          type: string
          format: email
        plan:
          type: string
          description: >-
            Plan slug or label, accepted case-insensitively. Valid slugs are
            basic-vps, standard-vps, professional-vps, and dedicated-server.
        vps_language:
          type: string
          default: english
          description: >-
            Language value or configured display label accepted
            case-insensitively. Values are english, spanish, french, german,
            italian, portuguese, russian, chinese, arabic, malay, thai,
            vietnamese, hindi, urdu, bengali, turkish, polish, ukrainian,
            romanian, and dutch.
        auto_approve:
          type: boolean
          default: true
        trading_account_number:
          type:
            - string
            - 'null'
        notes:
          type:
            - string
            - 'null'
    SuccessEnvelope:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          const: true
        message:
          type: string
        pagination:
          $ref: '#/components/schemas/Pagination'
    ServiceCreateResult:
      type: object
      properties:
        service_number:
          type: integer
        request_id:
          type:
            - string
            - 'null'
        service_status:
          type: string
        request_status:
          type: string
        message:
          type: string
        credentials:
          type: object
          properties:
            ip:
              type: string
            password:
              type: string
        created_date:
          type: string
          format: date-time
        client_name:
          type: string
        client_email:
          type: string
          format: email
        plan:
          type: string
        vps_language:
          type: string
        trading_account_number:
          type:
            - string
            - 'null'
        notes:
          type:
            - string
            - 'null'
    ReviewResult:
      type: object
      required:
        - request_id
        - request_status
        - message
      properties:
        request_id:
          type:
            - string
            - 'null'
        request_status:
          type: string
          enum:
            - pending
            - processing
            - nycservers_review
        message:
          type: string
        service_number:
          type:
            - integer
            - 'null'
        service_status:
          type: string
          const: pending
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/Error'
    Pagination:
      type: object
      required:
        - page
        - perPage
        - total
        - totalPages
      properties:
        page:
          type: integer
          minimum: 1
        perPage:
          type: integer
          minimum: 1
          maximum: 100
        total:
          type: integer
          minimum: 0
        totalPages:
          type: integer
          minimum: 0
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
  responses:
    AuthenticationError:
      description: >-
        Code `authentication_failed` for a missing, malformed, invalid,
        inactive, or expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: authentication_failed
              message: Invalid API key
    PermissionError:
      description: >-
        Code `insufficient_permissions` when the request IP is not whitelisted
        or a required scope is missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: insufficient_permissions
              message: IP address not whitelisted
    RateLimitError:
      description: Code `rate_limit_exceeded` when the API key exceeds its rate limit.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: rate_limit_exceeded
              message: Rate limit exceeded
    ServerError:
      description: >-
        Code `server_error` when authentication or internal processing cannot
        complete.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: server_error
              message: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Send the API key in the Authorization bearer header. Production keys
        begin with `sk_live_`.

````