Ultralytics Lifecycle API

Restore or permanently delete trashed projects, datasets, and models.

Operations 3

GET /api/trash View trash #
POST /api/trash Restore a trashed item #
DELETE /api/trash Permanently delete trash #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ultralytics:ultralytics-lifecycle-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ultralytics-lifecycle-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ultralytics Platform Lifecycle API
  summary: Build, train, and deploy YOLO models with the Ultralytics Platform REST API.
  version: 0.1.84
  description: The Ultralytics Platform API lets you manage datasets, train models on cloud GPUs, deploy inference endpoints, and more — all from your own code. See the Quickstart to get started.
  termsOfService: https://www.ultralytics.com/legal/terms-of-service
  contact:
    name: Ultralytics
    url: https://www.ultralytics.com
  license:
    name: AGPL-3.0
    identifier: AGPL-3.0-only
    url: https://www.ultralytics.com/license
servers:
- url: https://platform.ultralytics.com
  description: Production
security:
- BearerAuth: []
tags:
- name: Lifecycle
  description: Restore or permanently delete trashed projects, datasets, and models.
paths:
  /api/trash:
    get:
      summary: View trash
      tags:
      - Lifecycle
      operationId: get_api_trash
      description: Returns restorable trash, or previews affected models and permanently deleted deployments when id and type are provided. Trash expires after 30 days.
      parameters:
      - name: id
        in: query
        required: false
        description: Preview resources affected by deleting this model or project
        schema:
          type: string
          minLength: 1
          maxLength: 128
          example: 507f1f77bcf86cd799439011
      - name: type
        in: query
        required: false
        schema:
          default: all
          anyOf:
          - type: string
            const: all
          - type: string
            enum:
            - project
            - dataset
            - model
      - name: page
        in: query
        required: false
        schema:
          default: 1
          type: integer
          exclusiveMinimum: 0
      - name: limit
        in: query
        required: false
        schema:
          default: 50
          type: integer
          exclusiveMinimum: 0
          maximum: 200
      responses:
        '200':
          description: Trashed items or deletion preview
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/ListTrashResponse'
                - $ref: '#/components/schemas/TrashPreviewResponse'
        '400':
          description: Invalid pagination or resource type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Workspace access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Preview resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - label: Python SDK
        lang: Python
        source: 'from ultralytics_platform import Platform


          client = Platform()  # Reads ULTRALYTICS_API_KEY

          response = client.lifecycle.trash()

          print(response)'
    post:
      summary: Restore a trashed item
      tags:
      - Lifecycle
      operationId: post_api_trash
      description: Restores a trashed project, dataset, or model before its retention period expires.
      x-sdk-method: restore
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: Trashed resource ID
                  example: 507f1f77bcf86cd799439011
                type:
                  type: string
                  enum:
                  - project
                  - dataset
                  - model
              required:
              - id
              - type
              additionalProperties: false
              description: Move/restore a trashable resource
      responses:
        '200':
          description: Item restored
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestoreTrashResponse'
        '400':
          description: Invalid request or resource cannot be changed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Workspace editor access required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Trash operation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - label: Python SDK
        lang: Python
        source: "from ultralytics_platform import Platform\n\nclient = Platform()  # Reads ULTRALYTICS_API_KEY\nresponse = client.lifecycle.restore(\n    id=\"507f1f77bcf86cd799439011\",\n    type=\"project\",\n)\nprint(response)"
    delete:
      summary: Permanently delete trash
      tags:
      - Lifecycle
      operationId: delete_api_trash
      description: Permanently deletes one trashed resource or all workspace trash. This cannot be undone.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    maxLength: 128
                    description: Trashed resource ID
                    example: 507f1f77bcf86cd799439011
                  type:
                    type: string
                    enum:
                    - project
                    - dataset
                    - model
                required:
                - id
                - type
                additionalProperties: false
                description: Move/restore a trashable resource
              - type: object
                properties:
                  all:
                    type: boolean
                    const: true
                required:
                - all
                additionalProperties: false
              description: Permanently delete one trashable resource or all workspace trash
      responses:
        '200':
          description: Trash permanently deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteTrashResponse'
        '400':
          description: Invalid request or resource cannot be changed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Workspace editor access required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Trash operation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - label: Python SDK
        lang: Python
        source: "from ultralytics_platform import Platform\n\nclient = Platform()  # Reads ULTRALYTICS_API_KEY\nresponse = client.lifecycle.delete_trash(\n    body={\"id\": \"507f1f77bcf86cd799439011\", \"type\": \"project\"},\n)\nprint(response)"
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: Invalid request
      required:
      - error
      additionalProperties: false
      description: Standard error response
    TrashPreviewResponse:
      type: object
      properties:
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
                enum:
                - project
                - model
                - deployment
              name:
                type: string
              region:
                type: string
            required:
            - id
            - type
            - name
            additionalProperties: false
      required:
      - resources
      additionalProperties: false
    RestoreTrashResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
        restoredModels:
          type: integer
          minimum: 0
      required:
      - success
      additionalProperties: false
    ListTrashResponse:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              type:
                type: string
                enum:
                - project
                - dataset
                - model
              name:
                type: string
              slug:
                type: string
              trashedAt:
                type: string
                format: date-time
                pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
              daysRemaining:
                type: integer
                minimum: 0
              cascadedCount:
                type: integer
                minimum: 0
              parentProject:
                type: object
                properties:
                  _id:
                    type: string
                  name:
                    type: string
                  slug:
                    type: string
                required:
                - _id
                - name
                - slug
                additionalProperties: false
              sizeBytes:
                type: number
                minimum: 0
            required:
            - _id
            - type
            - name
            - slug
            - trashedAt
            - daysRemaining
            additionalProperties: false
        total:
          type: integer
          minimum: 0
        page:
          type: integer
          exclusiveMinimum: 0
        limit:
          type: integer
          exclusiveMinimum: 0
        totalPages:
          type: integer
          minimum: 0
        summary:
          type: object
          properties:
            totalItems:
              type: integer
              minimum: 0
            totalSizeBytes:
              type: number
              minimum: 0
            byType:
              type: object
              properties:
                projects:
                  type: object
                  properties:
                    count:
                      type: integer
                      minimum: 0
                  required:
                  - count
                  additionalProperties: false
                datasets:
                  type: object
                  properties:
                    count:
                      type: integer
                      minimum: 0
                    sizeBytes:
                      type: number
                      minimum: 0
                  required:
                  - count
                  - sizeBytes
                  additionalProperties: false
                models:
                  type: object
                  properties:
                    count:
                      type: integer
                      minimum: 0
                    sizeBytes:
                      type: number
                      minimum: 0
                  required:
                  - count
                  - sizeBytes
                  additionalProperties: false
                exports:
                  type: object
                  properties:
                    count:
                      type: integer
                      minimum: 0
                    sizeBytes:
                      type: number
                      minimum: 0
                  required:
                  - count
                  - sizeBytes
                  additionalProperties: false
              required:
              - projects
              - datasets
              - models
              - exports
              additionalProperties: false
          required:
          - totalItems
          - totalSizeBytes
          - byType
          additionalProperties: false
        region:
          type: string
          enum:
          - us
          - eu
          - ap
          description: Data region where data is stored
      required:
      - items
      - total
      - page
      - limit
      - totalPages
      - summary
      - region
      additionalProperties: false
      description: Restorable resources in the workspace trash
    DeleteTrashResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
        deletedCount:
          type: integer
          minimum: 0
        cascadedModels:
          type: integer
          minimum: 0
        survivingDeployments:
          type: integer
          minimum: 0
      required:
      - success
      - deletedCount
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key starting with `ul_`. Create one at platform.ultralytics.com under Settings > API Keys.
externalDocs:
  description: Full documentation with guides and examples
  url: https://docs.ultralytics.com/platform/api