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

# Creates a plug

> Creates a plug. Required permission: assets:plug:create



## OpenAPI

````yaml /api/core-api/crmiapi.json post /api/v1/assets/plugs
openapi: 3.1.1
info:
  title: chargecloud - Core API
  summary: chargecloud Core API. All around CRM, Asset Management and more.
  version: 1.113.1
  description: chargecloud Core API. All around CRM, Asset Management and more.
servers:
  - url: https://api.chargecloud.dev
    description: Production - chargecloud Core API
  - url: https://demo.chargecloud.de
    description: Sandbox/Dev - chargecloud Core API
security: []
paths:
  /api/v1/assets/plugs:
    post:
      tags:
        - Plugs
      summary: Creates a plug
      description: 'Creates a plug. Required permission: assets:plug:create'
      operationId: /api/v1/assets/plugs_POST
      parameters: []
      requestBody:
        description: 'Creates a plug. Required permission: assets:plug:create'
        content:
          application/json:
            schema:
              type: object
              required:
                - chargepoint_id
                - type_id
                - phase
                - ampere
                - voltage
                - max_power
                - active
                - fixable
                - with_cable
                - cable_length
                - export
              properties:
                chargepoint_id:
                  type: integer
                  format: int32
                  minimum: 0
                  description: chargepoint id
                type_id:
                  type: integer
                  format: int32
                  minimum: 0
                  description: Plug type id
                phase:
                  type: string
                  enum:
                    - ac1
                    - ac3
                    - dc
                  description: Phase of the plug
                ampere:
                  type: integer
                  format: int32
                  minimum: 0
                  description: Ampere of the plug
                voltage:
                  type: integer
                  format: int32
                  minimum: 0
                  description: Voltage of the plug
                max_power:
                  type: integer
                  format: int32
                  minimum: 0
                  description: Maximum power of the plug
                active:
                  type: boolean
                  default: true
                  description: Status of the plug
                fixable:
                  type: boolean
                  default: true
                  description: Is the plug fixable
                with_cable:
                  type: boolean
                  default: false
                  description: Is the plug with a fixed cable
                cable_length:
                  type: integer
                  format: int32
                  minimum: 0
                  description: Plugs cable length
                comment:
                  type: string
                  maxLength: 255
                  description: Internal comments for the plug
                export:
                  type: boolean
                  default: false
                  description: Should the plug be shown in external APIs
                serial_number:
                  type: string
                  maxLength: 25
                  description: Serial number of the plug
                article_number:
                  type: string
                  maxLength: 25
                  description: Article number of the plug
        required: true
      responses:
        '201':
          description: Plug created
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - plug
                properties:
                  plug:
                    type: object
                    properties:
                      id:
                        type: integer
                        format: int32
                        description: Plug id
                      created_at:
                        type: string
                        format: date
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        description: Date of creation
                      updated_at:
                        type: string
                        format: date
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        description: Date of update
                      chargepoint_id:
                        type: integer
                        format: int32
                        minimum: 0
                        description: chargepoint id
                      type_id:
                        type: integer
                        format: int32
                        minimum: 0
                        description: Plug type id
                      phase:
                        type: string
                        enum:
                          - ac1
                          - ac3
                          - dc
                        description: Phase of the plug
                      ampere:
                        type: integer
                        format: int32
                        minimum: 0
                        description: Ampere of the plug
                      voltage:
                        type: integer
                        format: int32
                        minimum: 0
                        description: Voltage of the plug
                      max_power:
                        type: integer
                        format: int32
                        minimum: 0
                        description: Maximum power of the plug
                      active:
                        type: boolean
                        default: true
                        description: Status of the plug
                      fixable:
                        type: boolean
                        default: true
                        description: Is the plug fixable
                      with_cable:
                        type: boolean
                        default: false
                        description: Is the plug with a fixed cable
                      cable_length:
                        type: integer
                        format: int32
                        minimum: 0
                        description: Plugs cable length
                      comment:
                        type: string
                        maxLength: 255
                        description: Internal comments for the plug
                      export:
                        type: boolean
                        default: false
                        description: Should the plug be shown in external APIs
                      serial_number:
                        type: string
                        maxLength: 25
                        description: Serial number of the plug
                      article_number:
                        type: string
                        maxLength: 25
                        description: Article number of the plug
                    required:
                      - id
                      - created_at
                      - updated_at
                      - chargepoint_id
                      - type_id
                      - phase
                      - ampere
                      - voltage
                      - max_power
                      - active
                      - fixable
                      - with_cable
                      - cable_length
                      - export
                    description: Plug
        '401':
          description: Unauthorized
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '404':
          description: Not found
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '405':
          description: Method not allowed
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '422':
          description: Request validation failed
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        errorKey:
                          type: string
                          description: A key identifying the error
                        message:
                          type: string
                          description: The error message
                        parameter:
                          type: string
                          description: The parameter that caused the error, if any
                      required:
                        - errorKey
                        - message
                        - parameter
                      description: Error
                    description: List of errors
        '429':
          description: Too many requests
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '500':
          description: Internal server error
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
      security:
        - bearer:
            - asset:plug
components:
  headers:
    Content-Language:
      description: The locale of the response content (BCP 47 language tag).
      schema:
        type: string
        example: en
  securitySchemes:
    bearer:
      type: http
      description: OAuth2 Bearer Authorization
      scheme: bearer
      bearerFormat: JWT

````

## Related topics

- [Updates a plug](/api-reference/plugs/updates-a-plug.md)
- [Retrieves plugs](/api-reference/plugs/retrieves-plugs.md)
- [Deletes a plug](/api-reference/plugs/deletes-a-plug.md)
