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

# Share a container image

> Shares a container image with another workspace by copying the metadata record. The underlying storage (S3) data is not duplicated. For same-account targets the share is applied immediately. For cross-account targets, a pending image share is created and must be explicitly accepted by an admin of the target workspace; the correct target account ID must be supplied as an anti-spam measure.



## OpenAPI

````yaml /api-reference/controlplane.yml post /images/{resourceType}/{imageName}/share
openapi: 3.0.3
info:
  title: Blaxel Control Plane
  version: 0.0.1
servers:
  - description: Blaxel Control Plane
    url: https://api.blaxel.ai/v0
  - description: Blaxel Inference
    url: https://run.blaxel.ai
security:
  - OAuth2:
      - admin
  - ApiKeyAuth: []
paths:
  /images/{resourceType}/{imageName}/share:
    parameters:
      - description: Resource type (agents, functions, sandboxes, jobs)
        in: path
        name: resourceType
        required: true
        schema:
          type: string
      - description: Name of the container image repository
        in: path
        name: imageName
        required: true
        schema:
          type: string
    post:
      tags:
        - images
      summary: Share a container image
      description: >-
        Shares a container image with another workspace by copying the metadata
        record. The underlying storage (S3) data is not duplicated. For
        same-account targets the share is applied immediately. For cross-account
        targets, a pending image share is created and must be explicitly
        accepted by an admin of the target workspace; the correct target account
        ID must be supplied as an anti-spam measure.
      operationId: ShareImage
      requestBody:
        content:
          application/json:
            schema:
              properties:
                targetAccountId:
                  description: >-
                    Account ID of the target workspace. Required when the target
                    workspace belongs to a different account than the source
                    workspace (anti-spam).
                  type: string
                targetWorkspace:
                  description: Name of the workspace to share the image with
                  type: string
              required:
                - targetWorkspace
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Image'
          description: successful operation (same-account share, applied immediately)
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PendingImageShare'
          description: pending approval from target workspace admin
        '400':
          description: invalid request
        '404':
          description: image not found
        '409':
          description: image conflict in target workspace
      security:
        - OAuth2:
            - images:share
        - ApiKeyAuth: []
components:
  schemas:
    Image:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/ImageMetadata'
        spec:
          $ref: '#/components/schemas/ImageSpec'
      required:
        - metadata
        - spec
    PendingImageShare:
      type: object
      description: >-
        Pending cross-account image share awaiting approval from the destination
        workspace
      allOf:
        - $ref: '#/components/schemas/TimeFields'
        - $ref: '#/components/schemas/OwnerFields'
        - properties:
            expiresAt:
              type: string
              description: The date and time when the pending share expires
            id:
              type: string
              description: Unique identifier for the pending image share
            imageName:
              type: string
              description: Image name (repository)
            resourceType:
              type: string
              description: Resource type (agent, function, sandbox, job)
            sharedBy:
              type: string
              description: User sub who initiated the share
            sourceAccountId:
              type: string
              description: Source account ID
            sourceWorkspace:
              type: string
              description: Source workspace name
            targetAccountId:
              type: string
              description: Target account ID
            targetWorkspace:
              type: string
              description: Target workspace name
    ImageMetadata:
      type: object
      properties:
        createdAt:
          type: string
          description: The date and time when the image was created.
          readOnly: true
        displayName:
          type: string
          description: The display name of the image (registry/workspace/repository).
        events:
          $ref: '#/components/schemas/CoreEvents'
        lastDeployedAt:
          type: string
          description: >-
            The date and time when the image was last deployed (most recent
            across all tags).
          readOnly: true
        name:
          type: string
          description: The name of the image (repository name).
        resourceType:
          type: string
          description: The resource type of the image.
        sourceWorkspace:
          type: string
          description: >-
            If this image is shared from another workspace, this field contains
            the name of the source workspace. Empty for non-shared images.
          readOnly: true
        status:
          $ref: '#/components/schemas/Status'
        updatedAt:
          type: string
          description: The date and time when the image was last updated.
          readOnly: true
        workspace:
          type: string
          description: The workspace of the image.
          readOnly: true
    ImageSpec:
      type: object
      properties:
        size:
          type: integer
          description: The size of the image in bytes.
          readOnly: true
        tags:
          type: array
          description: List of tags available for this image.
          items:
            $ref: '#/components/schemas/ImageTag'
    TimeFields:
      type: object
      description: Time fields for Persistance
      properties:
        createdAt:
          type: string
          description: The date and time when the resource was created
          readOnly: true
        updatedAt:
          type: string
          description: The date and time when the resource was updated
          readOnly: true
    OwnerFields:
      type: object
      description: Owner fields for Persistance
      properties:
        createdBy:
          type: string
          description: The user or service account who created the resource
          readOnly: true
        updatedBy:
          type: string
          description: The user or service account who updated the resource
          readOnly: true
    CoreEvents:
      type: array
      description: Events happening on a resource deployed on Blaxel
      items:
        $ref: '#/components/schemas/CoreEvent'
      readOnly: true
    Status:
      type: string
      description: Deployment status of a resource deployed on Blaxel
      enum:
        - DELETING
        - TERMINATED
        - FAILED
        - DEACTIVATED
        - DEACTIVATING
        - UPLOADING
        - BUILDING
        - DEPLOYING
        - DEPLOYED
        - BUILT
      readOnly: true
    ImageTag:
      type: object
      properties:
        createdAt:
          type: string
          description: The date and time when the tag was created.
          readOnly: true
        name:
          type: string
          description: The name of the tag.
        size:
          type: integer
          description: The size of the image in bytes.
          readOnly: true
        updatedAt:
          type: string
          description: The date and time when the tag was last updated.
          readOnly: true
    CoreEvent:
      type: object
      description: Core event
      properties:
        canaryRevision:
          type: string
          description: Canary revisionID link to the event
        message:
          type: string
          description: Event message
          example: Deployment successful
        revision:
          type: string
          description: RevisionID link to the event
          example: rev-abc123
        status:
          type: string
          description: Event status
          example: DEPLOYED
        time:
          type: string
          description: Event time
          example: '2025-01-15T10:30:00Z'
        type:
          type: string
          description: Event type
          example: deployment
      readOnly: true
  securitySchemes:
    OAuth2:
      description: OAuth2 authentication with JWT tokens
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize
          scopes:
            admin: Administrative access
            agents:create: Create agents
            agents:delete: Delete agents
            agents:get: Get agent details
            agents:list: List agents
            agents:update: Update agents
            apiKey:list: List API keys
            apiKey:write: Create and delete API keys
            configurations:list: List configurations
            customdomains:create: Create custom domains
            customdomains:delete: Delete custom domains
            customdomains:get: Get custom domain details
            customdomains:list: List custom domains
            customdomains:update: Update custom domains
            functions:create: Create functions
            functions:delete: Delete functions
            functions:get: Get function details
            functions:list: List functions
            functions:update: Update functions
            integrations:create: Create integrations
            integrations:list: List integrations
            invitations:list: List invitations
            jobs:create: Create jobs
            jobs:delete: Delete jobs
            jobs:get: Get job details
            jobs:list: List jobs
            jobs:update: Update jobs
            locations:list: List locations
            mcphub:list: List MCP hub resources
            models:create: Create models
            models:delete: Delete models
            models:get: Get model details
            models:list: List models
            models:update: Update models
            policies:create: Create policies
            policies:delete: Delete policies
            policies:get: Get policy details
            policies:list: List policies
            policies:update: Update policies
            sandboxes:control: Control sandbox operations
            sandboxes:create: Create sandboxes
            sandboxes:delete: Delete sandboxes
            sandboxes:get: Get sandbox details
            sandboxes:list: List sandboxes
            sandboxes:update: Update sandboxes
            sandboxhub:list: List sandbox hub resources
            templates:get: Get template details
            templates:list: List templates
            volumeTemplates:create: Create volume templates
            volumeTemplates:delete: Delete volume templates
            volumeTemplates:get: Get volume template details
            volumeTemplates:list: List volume templates
            volumeTemplates:upsert: Create or update volume templates
            volumes:create: Create volumes
            volumes:delete: Delete volumes
            volumes:get: Get volume details
            volumes:list: List volumes
            workspaces:accept: Accept workspace invitation
            workspaces:create: Create workspaces
            workspaces:decline: Decline workspace invitation
            workspaces:delete: Delete workspaces
            workspaces:get: Get workspace details
            workspaces:invite: Invite users to workspace
            workspaces:leave: Leave workspace
            workspaces:list: List workspaces
            workspaces:remove: Remove users from workspace
            workspaces:update: Update workspaces
          tokenUrl: /oauth/token
        clientCredentials:
          scopes:
            admin: Administrative access
            agents:create: Create agents
            agents:delete: Delete agents
            agents:get: Get agent details
            agents:list: List agents
            agents:update: Update agents
            apiKey:list: List API keys
            apiKey:write: Create and delete API keys
            configurations:list: List configurations
            customdomains:create: Create custom domains
            customdomains:delete: Delete custom domains
            customdomains:get: Get custom domain details
            customdomains:list: List custom domains
            customdomains:update: Update custom domains
            functions:create: Create functions
            functions:delete: Delete functions
            functions:get: Get function details
            functions:list: List functions
            functions:update: Update functions
            integrations:create: Create integrations
            integrations:list: List integrations
            invitations:list: List invitations
            jobs:create: Create jobs
            jobs:delete: Delete jobs
            jobs:get: Get job details
            jobs:list: List jobs
            jobs:update: Update jobs
            locations:list: List locations
            mcphub:list: List MCP hub resources
            models:create: Create models
            models:delete: Delete models
            models:get: Get model details
            models:list: List models
            models:update: Update models
            policies:create: Create policies
            policies:delete: Delete policies
            policies:get: Get policy details
            policies:list: List policies
            policies:update: Update policies
            sandboxes:control: Control sandbox operations
            sandboxes:create: Create sandboxes
            sandboxes:delete: Delete sandboxes
            sandboxes:get: Get sandbox details
            sandboxes:list: List sandboxes
            sandboxes:update: Update sandboxes
            sandboxhub:list: List sandbox hub resources
            templates:get: Get template details
            templates:list: List templates
            volumeTemplates:create: Create volume templates
            volumeTemplates:delete: Delete volume templates
            volumeTemplates:get: Get volume template details
            volumeTemplates:list: List volume templates
            volumeTemplates:upsert: Create or update volume templates
            volumes:create: Create volumes
            volumes:delete: Delete volumes
            volumes:get: Get volume details
            volumes:list: List volumes
            workspaces:accept: Accept workspace invitation
            workspaces:create: Create workspaces
            workspaces:decline: Decline workspace invitation
            workspaces:delete: Delete workspaces
            workspaces:get: Get workspace details
            workspaces:invite: Invite users to workspace
            workspaces:leave: Leave workspace
            workspaces:list: List workspaces
            workspaces:remove: Remove users from workspace
            workspaces:update: Update workspaces
          tokenUrl: /oauth/token
      type: oauth2
    ApiKeyAuth:
      bearerFormat: API Key
      description: Long-lived API key for programmatic access
      scheme: bearer
      type: http

````