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

# Restart the running application

> Needs deploy permission. The release does not change.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/deployments/{id}/restart
openapi: 3.1.0
info:
  title: Deployz vendor API
  version: 1.0.0
  description: >-
    Build releases and deploy them to your customers from your own pipeline.
    Create an API key on the API keys page of the Deployz dashboard, and send it
    in the header `Authorization: Bearer <key>`. A key has read or deploy
    permission and works only while the person who created it is an owner or an
    admin. Deploy, restart and rollback answer 202 with a job. Poll the job
    until its state is succeeded, failed or cancelled. Every answer is `{
    success, message, data, request_id }`, except this document. Every error is
    `{ success: false, error: { code, message }, request_id }`. The `request_id`
    is also the `X-Request-Id` header: quote it when you ask for support. A key
    can make 120 requests a minute. Over the limit the answer is 429 with a
    `Retry-After` header.
servers:
  - url: https://api.deployz.dev
security:
  - bearerAuth: []
tags:
  - name: Applications
    description: The applications of your organization.
  - name: Releases
    description: Build a release from a commit and follow its build.
  - name: Deployments
    description: Read deployments, and deploy, restart, or roll back one.
  - name: Operations
    description: Follow an operation that deploy, restart, or rollback started.
paths:
  /api/v1/deployments/{id}/restart:
    post:
      tags:
        - Deployments
      summary: Restart the running application
      description: Needs deploy permission. The release does not change.
      operationId: restartDeployment
      parameters:
        - name: id
          in: path
          required: true
          description: The deployment id.
          schema:
            type: string
            format: uuid
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            A value your pipeline chooses for this operation. Repeat the request
            with the same value and release to get the same job. The same value
            with another release answers 409 IDEMPOTENCY_KEY_REUSED.
          schema:
            type: string
      responses:
        '200':
          description: >-
            The same restart already exists: it is queued or running, or it was
            started with the same Idempotency-Key.
          headers:
            Location:
              description: The path of the job to poll.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    const: true
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/JobAccepted'
                  request_id:
                    type: string
                required:
                  - success
                  - message
                  - data
                  - request_id
              example:
                success: true
                message: Restart is already queued or running
                data:
                  jobId: 0d9c8b7a-6f5e-4d3c-9b2a-1f0e9d8c7b6a
                  state: queued
                request_id: 8c5d4c68-b488-41c7-934f-6f9e9ce83d7b
        '202':
          description: The restart is queued.
          headers:
            Location:
              description: The path of the job to poll.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    const: true
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/JobAccepted'
                  request_id:
                    type: string
                required:
                  - success
                  - message
                  - data
                  - request_id
              example:
                success: true
                message: Restart queued successfully
                data:
                  jobId: 0d9c8b7a-6f5e-4d3c-9b2a-1f0e9d8c7b6a
                  state: queued
                request_id: 8c5d4c68-b488-41c7-934f-6f9e9ce83d7b
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            The request conflicts with the current state. Codes:
            DEPLOYMENT_BUSY, DEPLOYMENT_NOT_DEPLOYABLE, RELAY_NOT_CONNECTED,
            RELAY_DISCONNECTED.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    JobAccepted:
      type: object
      properties:
        jobId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        state:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancelled
      required:
        - jobId
        - state
      additionalProperties: false
    Error:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          required:
            - code
            - message
          additionalProperties: false
        request_id:
          type: string
      required:
        - success
        - error
        - request_id
      additionalProperties: false
  responses:
    Unauthorized:
      description: >-
        The key is missing or not valid. Codes: API_KEY_INVALID,
        API_KEY_EXPIRED, KEY_CREATOR_INACTIVE.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error:
              code: API_KEY_INVALID
              message: The API key is not valid
            request_id: 8c5d4c68-b488-41c7-934f-6f9e9ce83d7b
    Forbidden:
      description: 'The key has read permission. Code: INSUFFICIENT_KEY_PERMISSION.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource does not exist in your organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: 'More than 120 requests in one minute. Code: RATE_LIMITED.'
      headers:
        Retry-After:
          description: Seconds to wait.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error:
              code: RATE_LIMITED
              message: Too many requests. Wait before you try again.
            request_id: 8c5d4c68-b488-41c7-934f-6f9e9ce83d7b
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'An API key: dz_<id>_<secret>.'

````

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