Skip to content

Commit

Permalink
feat(api): added openapi endpoints (#1422)
Browse files Browse the repository at this point in the history
Recently, we introduced two new endpoints that return the OpenAPI
specification:

- `/acts/<actorId>/builds/<buildId>/openapi-specification`
- `/actor-builds/<buildId>/openapi-specification`

**This PR updates the documentation to include these endpoints.**


@TC-MO Let me, please, know if you think we should add any additional
information 🙏
  • Loading branch information
danpoletaev authored Jan 22, 2025
1 parent 5859871 commit 8c7e259
Show file tree
Hide file tree
Showing 6 changed files with 442 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,348 @@
title: GetOpenApiResponse
type: object
properties:
openapi:
type: string
example: 3.0.1
info:
type: object
properties:
title:
type: string
example: Your Magic Actor
version:
type: string
example: '1.0'
x-build-id:
type: string
example: 'ID of build'
servers:
type: array
items:
type: object
properties:
url:
type: string
example: https://api.apify.com/v2
paths:
type: object
properties:
/acts/<username>~<actor>/run-sync-get-dataset-items:
type: object
properties:
post:
type: object
properties:
operationId:
type: string
example: run-sync-get-dataset-items
x-openai-isConsequential:
type: boolean
example: false
summary:
type: string
example: Executes an Actor, waits for its completion, and returns Actor's dataset items in response.
tags:
type: array
items:
type: string
example: ['Run Actor']
requestBody:
type: object
properties:
required:
type: boolean
example: true
content:
type: object
properties:
application/json:
type: object
properties:
schema:
type: object
properties:
$ref:
type: string
example: '#/components/schemas/inputSchema'
parameters:
type: array
items:
type: object
properties:
name:
type: string
example: token
in:
type: string
example: query
required:
type: boolean
example: true
schema:
type: object
properties:
type:
type: string
example: string
description:
type: string
example: Enter your Apify token here
responses:
type: object
properties:
'200':
type: object
properties:
description:
type: string
example: OK
/acts/<username>~<actor>/runs:
type: object
properties:
post:
type: object
properties:
operationId:
type: string
example: runs
x-openai-isConsequential:
type: boolean
example: false
summary:
type: string
example: Executes an Actor and returns information about the initiated run in response.
tags:
type: array
items:
type: string
example: ['Run Actor']
requestBody:
type: object
properties:
required:
type: boolean
example: true
content:
type: object
properties:
application/json:
type: object
properties:
schema:
type: object
properties:
$ref:
type: string
example: '#/components/schemas/inputSchema'
parameters:
type: array
items:
type: object
properties:
name:
type: string
in:
type: string
example: query
required:
type: boolean
schema:
type: object
properties:
type:
type: string
description:
type: string
responses:
type: object
properties:
'200':
type: object
properties:
description:
type: string
example: OK
content:
type: object
properties:
application/json:
type: object
properties:
schema:
type: object
properties:
$ref:
type: string
example: '#/components/schemas/runsResponseSchema'
/acts/<username>~<actor>/run-sync:
type: object
properties:
post:
type: object
properties:
operationId:
type: string
example: run-sync
x-openai-isConsequential:
type: boolean
example: false
summary:
type: string
example: Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.
tags:
type: array
items:
type: string
example: ['Run Actor']
requestBody:
type: object
properties:
required:
type: boolean
example: true
content:
type: object
properties:
application/json:
type: object
properties:
schema:
type: object
properties:
$ref:
type: string
example: '#/components/schemas/inputSchema'
parameters:
type: array
items:
type: object
properties:
name:
type: string
in:
type: string
example: query
required:
type: boolean
schema:
type: object
properties:
type:
type: string
description:
type: string
responses:
type: object
properties:
'200':
type: object
properties:
description:
type: string
example: OK
components:
type: object
properties:
schemas:
type: object
properties:
inputSchema:
type: object
properties:
type:
type: string
example: object
runsResponseSchema:
type: object
properties:
type:
type: string
example: object
properties:
type: object
properties:
data:
type: object
properties:
type:
type: string
example: object
properties:
type: object
properties:
id:
type: object
properties:
type:
type: string
example: string
actId:
type: object
properties:
type:
type: string
example: string
userId:
type: object
properties:
type:
type: string
example: string
startedAt:
type: object
properties:
type:
type: string
example: string
format:
type: string
example: date-time
example:
type: string
example: '2025-01-08T00:00:00.000Z'
finishedAt:
type: object
properties:
type:
type: string
example: string
format:
type: string
example: date-time
example:
type: string
example: '2025-01-08T00:00:00.000Z'
status:
type: object
properties:
type:
type: string
example: string
example:
type: string
example: 'READY'
meta:
type: object
properties:
type:
type: string
example: object
properties:
type: object
properties:
origin:
type: object
properties:
type:
type: string
example: string
example:
type: string
example: 'API'
userAgent:
type: object
properties:
type:
type: string
example: string
18 changes: 18 additions & 0 deletions apify-api/openapi/components/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@
```
In order to save new items to the dataset, send HTTP POST request with JSON payload to the same URL.
- name: Actors/Get OpenAPI specification
x-displayName: Get OpenAPI specification
x-parent-tag-name: Actors
x-trait: 'true'
description: |
Get the OpenAPI specification for Actor builds. Two similar endpoints are available:
- [First endpoint](/api/v2/act-openapi-specification-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build.
- [Second endpoint](/api/v2/actor-build-openapi-specification-get): Requires only `buildId`.
- name: Actor tasks
x-displayName: Actor tasks
x-legacy-doc-urls:
Expand Down Expand Up @@ -548,6 +557,15 @@
- '#tag/Actor-buildsBuild-log'
x-trait: 'true'
description: Check out [Logs](#/reference/logs) for full reference.
- name: Actor builds/Get OpenAPI specification
x-displayName: Get OpenAPI specification
x-parent-tag-name: Actor builds
x-trait: 'true'
description: |
Get the OpenAPI specification for Actor builds. Two similar endpoints are available:
- [First endpoint](/api/v2/act-openapi-specification-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build.
- [Second endpoint](/api/v2/actor-build-openapi-specification-get): Requires only `buildId`.
- name: Key-value stores
x-displayName: Key-value stores
x-legacy-doc-urls:
Expand Down
2 changes: 2 additions & 0 deletions apify-api/openapi/components/x-tag-groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Actors/Metamorph run
- Actors/Resurrect run
- Actors/Last run object and its storages
- Actors/Get OpenAPI specification
- name: Actor tasks
tags:
- Actor tasks
Expand Down Expand Up @@ -50,6 +51,7 @@
- Actor builds/Delete build
- Actor builds/Abort build
- Actor builds/Build log
- Actor builds/Get OpenAPI specification
- name: Key-value stores
tags:
- Key-value stores
Expand Down
Loading

0 comments on commit 8c7e259

Please sign in to comment.