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

# Créer un compte de service de compte

> Crée un compte de service et révèle son jeton une seule fois.

<script src="/locale-bridge.js" />


## OpenAPI

````yaml /openapi.fr.json POST /v1/public/accounts/{account_id}/auth/service-accounts
openapi: 3.1.0
info:
  title: Code API (Public)
  version: 1.0.0
servers:
  - url: https://api.hybridbox.io
security: []
paths:
  /v1/public/accounts/{account_id}/auth/service-accounts:
    post:
      tags:
        - public-accounts
        - public-account-auth
      summary: Créer un compte de service de compte
      description: Crée un compte de service et révèle son jeton une seule fois.
      operationId: >-
        create_public_account_service_account_v1_public_accounts__account_id__auth_service_accounts_post
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            format: uuid
            title: Account Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceAccountCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceAccountCreateResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Erreur de validation
      security:
        - PublicBearerAuth: []
components:
  schemas:
    ServiceAccountCreateRequest:
      description: Corps de requête pour créer un compte de service.
      properties:
        expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Horodatage UTC facultatif d’expiration du jeton
          title: expire à
        name:
          description: Nom du compte de service lisible par un humain
          maxLength: 120
          minLength: 1
          title: Nom
          type: string
      required:
        - name
      title: ServiceAccountCreateRequest
      type: object
    ServiceAccountCreateResponse:
      properties:
        account_id:
          format: uuid
          title: Id du compte
          type: string
        created_at:
          format: date-time
          title: Créé le
          type: string
        created_by_user_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: créé par User ID
        expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: expire à
        id:
          format: uuid
          title: ID
          type: string
        last_used_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Dernière utilisation
        name:
          title: Nom
          type: string
        revoked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: révoqué à
        revoked_by_user_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: ID de l’utilisateur ayant révoqué
        token:
          description: >-
            Jeton porteur en clair. Stockez-le maintenant; il ne sera plus
            jamais renvoyé.
          title: jeton
          type: string
        token_last4:
          title: 4 derniers caractères du jeton
          type: string
        token_prefix:
          title: Préfixe du jeton
          type: string
        token_public_id:
          title: ID public du jeton
          type: string
        updated_at:
          format: date-time
          title: Mis à jour le
          type: string
      required:
        - id
        - account_id
        - name
        - token_public_id
        - token_prefix
        - token_last4
        - created_at
        - updated_at
        - token
      title: ServiceAccountCreateResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Détail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Emplacement
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Type d erreur
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    PublicBearerAuth:
      bearerFormat: JWT or Hybridbox Service account token
      description: >-
        Public API bearer credential sent as `Authorization: Bearer <token>`.
        Use either an OAuth access token or a Hybridbox Service account token.
      scheme: bearer
      type: http

````