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

# Créer ou mettre à jour un opérateur externe

> Upsert synchrone par identifiant partenaire, sans exiger de SIREN. Une ressource supprimée logiquement est restaurée avec le même UUID; existing_marko_id lie explicitement une cible existante lors du premier envoi.



## OpenAPI

````yaml https://partner-api.marko.fr/v1/openapi.json put /operateurs/external/{external_id}
openapi: 3.1.0
info:
  title: MARKO External Partner API
  version: v1
  description: >-
    Stable external API contract for the live environment.


    Authentication flow for partner integrations:

    1. Generate an API key from the MARKO entity admin API section.

    2. Keep the raw API secret server-side and use it only to sign `POST
    /v1/auth/token`.

    3. Build the canonical message
    `MARKO-EXTERNAL-API-TOKEN-V1\n{key_id}\n{timestamp}\n{nonce}`.

    4. Sign that message with HMAC-SHA256 and send the hex signature with
    `key_id`, `timestamp` and `nonce`.

    5. Use the returned short-lived bearer on business endpoints as
    `Authorization: Bearer <access_token>`.

    The raw API secret must never be sent on business endpoints.


    This public contract intentionally excludes beta endpoints.
servers:
  - url: https://partner-api.marko.fr/v1
security:
  - BearerAuth: []
externalDocs:
  description: Download the matching Postman collection.
  url: /v1/postman.json
paths:
  /operateurs/external/{external_id}:
    put:
      tags:
        - operateurs
      summary: Créer ou mettre à jour un opérateur externe
      description: >-
        Upsert synchrone par identifiant partenaire, sans exiger de SIREN. Une
        ressource supprimée logiquement est restaurée avec le même UUID;
        existing_marko_id lie explicitement une cible existante lors du premier
        envoi.
      operationId: operateurs_external_upsert
      parameters:
        - in: path
          name: external_id
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9_~-][A-Za-z0-9._:~-]{0,254}$
            minLength: 1
            maxLength: 255
          example: CF-OPERATEUR-001
        - in: header
          name: X-Request-ID
          required: false
          description: >-
            Partner-generated correlation identifier echoed in logs and error
            payloads.
          schema:
            type: string
          example: marko-operateurs-external-upsert
        - in: header
          name: Idempotency-Key
          required: true
          description: >-
            Required for every write, including environments where replay
            deduplication is disabled. Reuse the same value when retrying the
            same logical write and use a new value for a different write.
          schema:
            type: string
            maxLength: 255
            pattern: ^[!-~]+$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                name:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Name
                siren:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Siren
                type:
                  anyOf:
                    - description: Type d'opérateur.
                      enum:
                        - promoteur
                        - marchand_de_biens
                        - asset_manager
                        - fonciere
                        - entrepreneur_general
                      title: OperateurType
                      type: string
                    - type: 'null'
                  default: null
                data:
                  additionalProperties: true
                  title: Data
                  type: object
                existing_marko_id:
                  anyOf:
                    - type: string
                      format: uuid
                    - type: 'null'
                  default: null
                  title: Existing Marko Id
              title: ExternalOperateurUpsertRequest
              type: object
            example:
              name: Promoteur Demo
              type: promoteur
              data: {}
      responses:
        '200':
          description: Additional successful response
          content:
            application/json:
              schema:
                properties:
                  external_id:
                    title: External Id
                    type: string
                  marko_id:
                    format: uuid
                    title: Marko Id
                    type: string
                  outcome:
                    enum:
                      - created
                      - updated
                      - noop
                      - restored
                      - bound
                    title: Outcome
                    type: string
                  resource:
                    properties:
                      name:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Name
                      siren:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Siren
                      type:
                        anyOf:
                          - description: Type d'opérateur.
                            enum:
                              - promoteur
                              - marchand_de_biens
                              - asset_manager
                              - fonciere
                              - entrepreneur_general
                            title: OperateurType
                            type: string
                          - type: 'null'
                        default: null
                      id:
                        format: uuid
                        title: Id
                        type: string
                      data:
                        additionalProperties: true
                        title: Data
                        type: object
                      source_extraction:
                        title: Source Extraction
                        type: boolean
                      litiges_en_cours:
                        title: Litiges En Cours
                        type: boolean
                      litiges_detail:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Litiges Detail
                      created_at:
                        format: date-time
                        title: Created At
                        type: string
                      updated_at:
                        format: date-time
                        title: Updated At
                        type: string
                      responsable_interne:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Responsable Interne
                      reputation_gouvernance_score:
                        anyOf:
                          - type: number
                          - type: 'null'
                        default: null
                        title: Reputation Gouvernance Score
                      reputation_gouvernance_label:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Reputation Gouvernance Label
                      forme_societe_mere:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Forme Societe Mere
                      siren_mere:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Siren Mere
                    required:
                      - id
                      - data
                      - source_extraction
                      - litiges_en_cours
                      - created_at
                      - updated_at
                    title: OperateurResponse
                    type: object
                  taxonomy_additions:
                    items:
                      properties:
                        parent_code:
                          anyOf:
                            - enum:
                                - due_diligence
                                - en_cours
                                - en_recouvrement
                                - termine
                              type: string
                            - type: 'null'
                          default: null
                          title: Parent Code
                        code:
                          title: Code
                          type: string
                        dimension:
                          enum:
                            - operation_status
                            - investment_type
                            - operation_type
                            - asset_class
                            - internal_status
                            - operational_status
                            - follow_up_category
                          title: Dimension
                          type: string
                        display_label:
                          title: Display Label
                          type: string
                        source_kind:
                          enum:
                            - marko
                            - partner
                            - entity
                          title: Source Kind
                          type: string
                        source_display_name:
                          title: Source Display Name
                          type: string
                        is_visible:
                          title: Is Visible
                          type: boolean
                        is_active:
                          title: Is Active
                          type: boolean
                        position:
                          title: Position
                          type: integer
                        usage_count:
                          default: 0
                          title: Usage Count
                          type: integer
                        label_editable:
                          title: Label Editable
                          type: boolean
                        canonical_code:
                          anyOf:
                            - type: string
                            - type: 'null'
                          default: null
                          title: Canonical Code
                        icon_key:
                          anyOf:
                            - enum:
                                - tag
                                - briefcase
                                - building
                                - landmark
                                - home
                                - map
                                - layers
                                - shield
                                - trending-up
                                - calendar
                                - circle-check
                                - triangle-alert
                              type: string
                            - type: 'null'
                          default: null
                          title: Icon Key
                      required:
                        - code
                        - dimension
                        - display_label
                        - source_kind
                        - source_display_name
                        - is_visible
                        - is_active
                        - position
                        - label_editable
                      title: EntityTaxonomyOptionResponse
                      type: object
                    title: Taxonomy Additions
                    type: array
                  request_id:
                    title: Request Id
                    type: string
                required:
                  - external_id
                  - marko_id
                  - outcome
                  - resource
                  - request_id
                title: ExternalOperateurSyncUpsertResponse
                type: object
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  external_id:
                    title: External Id
                    type: string
                  marko_id:
                    format: uuid
                    title: Marko Id
                    type: string
                  outcome:
                    enum:
                      - created
                      - updated
                      - noop
                      - restored
                      - bound
                    title: Outcome
                    type: string
                  resource:
                    properties:
                      name:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Name
                      siren:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Siren
                      type:
                        anyOf:
                          - description: Type d'opérateur.
                            enum:
                              - promoteur
                              - marchand_de_biens
                              - asset_manager
                              - fonciere
                              - entrepreneur_general
                            title: OperateurType
                            type: string
                          - type: 'null'
                        default: null
                      id:
                        format: uuid
                        title: Id
                        type: string
                      data:
                        additionalProperties: true
                        title: Data
                        type: object
                      source_extraction:
                        title: Source Extraction
                        type: boolean
                      litiges_en_cours:
                        title: Litiges En Cours
                        type: boolean
                      litiges_detail:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Litiges Detail
                      created_at:
                        format: date-time
                        title: Created At
                        type: string
                      updated_at:
                        format: date-time
                        title: Updated At
                        type: string
                      responsable_interne:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Responsable Interne
                      reputation_gouvernance_score:
                        anyOf:
                          - type: number
                          - type: 'null'
                        default: null
                        title: Reputation Gouvernance Score
                      reputation_gouvernance_label:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Reputation Gouvernance Label
                      forme_societe_mere:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Forme Societe Mere
                      siren_mere:
                        anyOf:
                          - type: string
                          - type: 'null'
                        default: null
                        title: Siren Mere
                    required:
                      - id
                      - data
                      - source_extraction
                      - litiges_en_cours
                      - created_at
                      - updated_at
                    title: OperateurResponse
                    type: object
                  taxonomy_additions:
                    items:
                      properties:
                        parent_code:
                          anyOf:
                            - enum:
                                - due_diligence
                                - en_cours
                                - en_recouvrement
                                - termine
                              type: string
                            - type: 'null'
                          default: null
                          title: Parent Code
                        code:
                          title: Code
                          type: string
                        dimension:
                          enum:
                            - operation_status
                            - investment_type
                            - operation_type
                            - asset_class
                            - internal_status
                            - operational_status
                            - follow_up_category
                          title: Dimension
                          type: string
                        display_label:
                          title: Display Label
                          type: string
                        source_kind:
                          enum:
                            - marko
                            - partner
                            - entity
                          title: Source Kind
                          type: string
                        source_display_name:
                          title: Source Display Name
                          type: string
                        is_visible:
                          title: Is Visible
                          type: boolean
                        is_active:
                          title: Is Active
                          type: boolean
                        position:
                          title: Position
                          type: integer
                        usage_count:
                          default: 0
                          title: Usage Count
                          type: integer
                        label_editable:
                          title: Label Editable
                          type: boolean
                        canonical_code:
                          anyOf:
                            - type: string
                            - type: 'null'
                          default: null
                          title: Canonical Code
                        icon_key:
                          anyOf:
                            - enum:
                                - tag
                                - briefcase
                                - building
                                - landmark
                                - home
                                - map
                                - layers
                                - shield
                                - trending-up
                                - calendar
                                - circle-check
                                - triangle-alert
                              type: string
                            - type: 'null'
                          default: null
                          title: Icon Key
                      required:
                        - code
                        - dimension
                        - display_label
                        - source_kind
                        - source_display_name
                        - is_visible
                        - is_active
                        - position
                        - label_editable
                      title: EntityTaxonomyOptionResponse
                      type: object
                    title: Taxonomy Additions
                    type: array
                  request_id:
                    title: Request Id
                    type: string
                required:
                  - external_id
                  - marko_id
                  - outcome
                  - resource
                  - request_id
                title: ExternalOperateurSyncUpsertResponse
                type: object
              example:
                external_id: CF-OPERATEUR-001
                marko_id: aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
                outcome: created
                resource:
                  id: aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
                  name: Promoteur Demo
                  data: {}
                  source_extraction: false
                  litiges_en_cours: false
                  created_at: '2026-08-22T08:00:00Z'
                  updated_at: '2026-08-22T08:00:00Z'
                taxonomy_additions: []
                request_id: req_cf_operateur_upsert
        '400':
          description: Invalid Idempotency-Key header
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: about:blank
                title: Bad Request
                status: 400
                detail: >-
                  Idempotency-Key must contain at most 255 visible ASCII
                  characters without spaces.
                request_id: req_example_partner_call
        '401':
          description: Authentication required
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: about:blank
                title: Unauthorized
                status: 401
                detail: A valid bearer token is required.
                request_id: req_example_partner_call
        '403':
          description: Scope, route or IP restriction
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: about:blank
                title: Forbidden
                status: 403
                detail: The API key does not allow this operation.
                request_id: req_example_partner_call
        '409':
          description: Idempotency or write target conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: about:blank
                title: Conflict
                status: 409
                detail: >-
                  The idempotency key payload, external reference, target, or
                  source conflicts with an existing write.
                request_id: req_example_partner_call
        '422':
          description: Validation failed
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: about:blank
                title: Unprocessable Content
                status: 422
                detail: The request payload or parameters are invalid.
                request_id: req_example_partner_call
        '428':
          description: Required Idempotency-Key header is missing
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: about:blank
                title: Precondition Required
                status: 428
                detail: The Idempotency-Key header is required.
                request_id: req_example_partner_call
        '429':
          description: Rate limit or progressive ban
          headers:
            Retry-After:
              description: Cooldown in seconds before retrying the request.
              schema:
                type: string
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: about:blank
                title: Too Many Requests
                status: 429
                detail: The request rate limit was exceeded.
                request_id: req_example_partner_call
        '500':
          description: Unexpected server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: about:blank
                title: Internal Server Error
                status: 500
                detail: An unexpected server error occurred.
                request_id: req_example_partner_call
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ProblemDetails:
      type: object
      required:
        - title
        - status
        - detail
      properties:
        type:
          type: string
          default: about:blank
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        request_id:
          type: string
        scope:
          type: string
        route_id:
          type: string
        reason_code:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: MARKO short-lived bearer
      description: >-
        Use the `access_token` returned by `POST /v1/auth/token`. Do not send
        the raw API secret on business endpoints.

````