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

# Confirm an uploaded avatar and attach it to the supplier

> Step 2 of 2: attaches the uploaded image to the supplier and returns the enriched supplier with its new avatar. Pass the `variantId` from the presign response, not the `uploadId`.

Resizing happens asynchronously after your upload lands, so calling this straight away often returns 400 "Avatar variant not ready yet". That is a retry signal, not a failure — back off a second or two and call again; the upload is fine. Only a successful call here attaches anything, so an upload that is never confirmed leaves the supplier unchanged. Confirming a different `variantId` replaces the current avatar and deletes the old image variants, which cannot be undone; re-confirming the same one is harmless.



## OpenAPI

````yaml /api-reference/openapi.json put /v1/projects/{projectId}/suppliers/{supplierId}/avatar
openapi: 3.0.0
info:
  title: MarketBox 2.0 Open API
  version: 1.0.0
  description: >-
    The MarketBox public API for building booking experiences. Core model:
    create an order, then draw its order items down into bookings. Single
    bookings reference an order item per service line; package bookings draw one
    PACKAGE item down across N sessions. To schedule a package, build a slate
    (POST /availability/package-slate) and book it by slateId (POST
    /orders/{orderId}/package-bookings). See the guides for end-to-end
    walkthroughs.
  contact:
    name: MarketBox support
servers:
  - url: https://apiv2.gomarketbox.com
    description: MarketBox Open API
security:
  - ApiKeyAuth: []
paths:
  /v1/projects/{projectId}/suppliers/{supplierId}/avatar:
    put:
      tags:
        - Suppliers
      summary: Confirm an uploaded avatar and attach it to the supplier
      description: >-
        Step 2 of 2: attaches the uploaded image to the supplier and returns the
        enriched supplier with its new avatar. Pass the `variantId` from the
        presign response, not the `uploadId`.


        Resizing happens asynchronously after your upload lands, so calling this
        straight away often returns 400 "Avatar variant not ready yet". That is
        a retry signal, not a failure — back off a second or two and call again;
        the upload is fine. Only a successful call here attaches anything, so an
        upload that is never confirmed leaves the supplier unchanged. Confirming
        a different `variantId` replaces the current avatar and deletes the old
        image variants, which cannot be undone; re-confirming the same one is
        harmless.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              The project (tenant) that owns the resource. Every resource in
              this API is scoped to a project, and your API key is restricted to
              the projects it was issued for — a project outside that scope
              returns 403.
            example: prj_01kv60qgnef2kt3pvqgwmkbzfr
          required: true
          description: >-
            The project (tenant) that owns the resource. Every resource in this
            API is scoped to a project, and your API key is restricted to the
            projects it was issued for — a project outside that scope returns
            403.
          name: projectId
          in: path
        - schema:
            type: string
            minLength: 1
            description: The supplier — the person or resource delivering the service.
            example: sup_01kv60qh1k5xylm7r0c1qj8zpa
          required: true
          description: The supplier — the person or resource delivering the service.
          name: supplierId
          in: path
      requestBody:
        description: Confirm payload
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                uploadId:
                  type: string
                variantId:
                  type: string
              required:
                - uploadId
                - variantId
      responses:
        '200':
          description: Supplier with avatar attached
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      supplierId:
                        type: string
                      firstName:
                        type: string
                      lastName:
                        type: string
                      email:
                        type: string
                      phone:
                        type: string
                      addressoneline:
                        type: string
                      longitude:
                        type: number
                      latitude:
                        type: number
                      city:
                        type: string
                      state:
                        type: string
                      country:
                        type: string
                      postalcode:
                        type: string
                      bio:
                        type: string
                      maxTravelTime:
                        type: number
                      externalId:
                        type: string
                      externalData:
                        type: object
                        additionalProperties:
                          nullable: true
                      active:
                        type: boolean
                      updatedAt:
                        type: string
                      timezone:
                        type: string
                        description: >-
                          The supplier's own IANA timezone. Absent when none is
                          set on the profile, in which case fall back to the
                          project's default timezone rather than the caller's.
                          Every `*Local` time this API renders for this supplier
                          is in this zone.
                        example: America/Toronto
                      avatarUrl:
                        type: string
                        nullable: true
                        format: uri
                      services:
                        type: array
                        items:
                          type: object
                          properties:
                            serviceId:
                              type: string
                            name:
                              type: object
                              additionalProperties:
                                type: string
                          required:
                            - serviceId
                            - name
                      skills:
                        type: array
                        items:
                          type: object
                          properties:
                            skillId:
                              type: string
                            name:
                              type: object
                              additionalProperties:
                                type: string
                          required:
                            - skillId
                            - name
                      locations:
                        type: array
                        items:
                          type: object
                          properties:
                            locationId:
                              type: string
                            locationType:
                              type: string
                              enum:
                                - PHYSICAL
                                - VIRTUAL
                                - TRAVEL_ZONE
                            name:
                              type: string
                            country:
                              type: string
                              nullable: true
                            state:
                              type: string
                              nullable: true
                            city:
                              type: string
                              nullable: true
                            addressOneLine:
                              type: string
                              nullable: true
                            street:
                              type: string
                              nullable: true
                            latitude:
                              type: number
                              nullable: true
                            longitude:
                              type: number
                              nullable: true
                            travelZoneType:
                              type: string
                              nullable: true
                              enum:
                                - CIRCULAR
                                - DRAWN
                                - null
                          required:
                            - locationId
                            - locationType
                            - name
                      servedRegions:
                        type: array
                        items:
                          type: string
                        description: >-
                          The region paths this supplier is indexed under — the
                          SAME set the `country`/`state`/`city` filter on `GET
                          /suppliers` matches against, so a supplier is returned
                          by that filter exactly when the query's path is in
                          this list. Slug paths at every hierarchy level,
                          sorted: `ca/`, `ca/on/`, `ca/on/toronto/`,
                          `ca/on/scarborough/`. Derived from the travel zones
                          and physical locations on their live schedules (see
                          `locations`), resolved to the locality, its borough
                          and the wider municipality. Empty when the supplier
                          has no live schedule with a geocodable zone. Region
                          rows are pruned by a daily sweep, so this can lag a
                          schedule's `endDate` by up to a day, whereas
                          `locations` is evaluated on every request.
                        example:
                          - ca/
                          - ca/on/
                          - ca/on/scarborough/
                          - ca/on/toronto/
                      languages:
                        type: array
                        items:
                          type: string
                      locales:
                        type: array
                        items:
                          type: string
                      defaultLocale:
                        type: string
                    required:
                      - supplierId
                      - firstName
                      - lastName
                      - email
                      - active
                      - updatedAt
                      - avatarUrl
                      - services
                      - skills
                      - locations
                      - servedRegions
                      - languages
                      - locales
                required:
                  - data
        '400':
          description: Variant not ready yet — retry shortly
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: API key cannot access this project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Supplier not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '409':
          description: >-
            The photo changed while this request was being saved, by another
            confirm or remove (CONFLICT): read the supplier again and retry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    ErrorMessage:
      type: object
      properties:
        code:
          type: string
          description: Stable machine-readable error code, e.g. NOT_FOUND.
        message:
          type: string
          description: Human-readable description of what went wrong.
        statusCode:
          type: integer
          description: The HTTP status code of this response.
        requestId:
          type: string
          description: >-
            The id of this request, also returned as the X-Request-Id header.
            Quote it in a support ticket.
      required:
        - code
        - message
        - statusCode
        - requestId
      example:
        code: NOT_FOUND
        message: Booking not found
        statusCode: 404
        requestId: a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key minted in the MarketBox dashboard. Scope is restricted to the
        projects you select at creation time. Every route needs the key's
        standard API access (`*`) except `POST /v1/projects/{projectId}/events`,
        which needs `events:write`; a key without `*` is refused with 403
        `CAPABILITY_NOT_GRANTED`.

````

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