diff --git a/docs/agents/create-agent-run.mdx b/docs/agents/create-agent-run.mdx new file mode 100644 index 000000000..e6af99b0c --- /dev/null +++ b/docs/agents/create-agent-run.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /v1/organizations/{org_id}/agent/run +--- \ No newline at end of file diff --git a/docs/agents/get-agent-run.mdx b/docs/agents/get-agent-run.mdx new file mode 100644 index 000000000..5b9e68106 --- /dev/null +++ b/docs/agents/get-agent-run.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /v1/organizations/{org_id}/agent/run/{agent_run_id} +--- \ No newline at end of file diff --git a/docs/api-reference/openapi3.json b/docs/api-reference/openapi3.json new file mode 100644 index 000000000..a1283d875 --- /dev/null +++ b/docs/api-reference/openapi3.json @@ -0,0 +1,622 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Developer API", + "description": "API for application developers", + "version": "1.0.0" + }, + "paths": { + "/v1/organizations/{org_id}/users": { + "get": { + "tags": ["users", "users", "users"], + "summary": "Get Users", + "description": "Get paginated list of users for a specific organization.\n\nReturns a paginated list of all users associated with the specified organization.\nThe requesting user must be a member of the organization to access this endpoint.\n\nRate limit: 60 requests per 30 seconds.", + "operationId": "get_users_v1_organizations__org_id__users_get", + "parameters": [ + { + "name": "org_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Org Id" } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 0, + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 1, + "default": 100, + "title": "Limit" + } + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "title": "Authorization" } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/Page_UserResponse_" } + } + } + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIRateLimitErrorResponse" + } + } + }, + "description": "Too Many Requests" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionsErrorResponse" + } + } + }, + "description": "Forbidden" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + } + } + }, + "/v1/organizations/{org_id}/users/{user_id}": { + "get": { + "tags": ["users", "users", "users"], + "summary": "Get User", + "description": "Get details for a specific user in an organization.\n\nReturns detailed information about a user within the specified organization.\nThe requesting user must be a member of the organization to access this endpoint.\n\nRate limit: 60 requests per 30 seconds.", + "operationId": "get_user_v1_organizations__org_id__users__user_id__get", + "parameters": [ + { + "name": "org_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "Org Id" } + }, + { + "name": "user_id", + "in": "path", + "required": true, + "schema": { "type": "string", "title": "User Id" } + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "title": "Authorization" } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/UserResponse" } + } + } + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIRateLimitErrorResponse" + } + } + }, + "description": "Too Many Requests" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionsErrorResponse" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserNotFoundErrorResponse" + } + } + }, + "description": "Not Found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + } + } + }, + "/v1/organizations/{org_id}/agent/run": { + "post": { + "tags": ["agents", "agents", "agents"], + "summary": "Create Agent Run", + "description": "Create a new agent run.\n\nCreates and initiates a long-running agent process based on the provided prompt.\nThe process will complete asynchronously, and the response contains the agent run ID\nwhich can be used to check the status later. The requesting user must be a member\nof the specified organization.\n\nRate limit: 10 requests per minute.", + "operationId": "create_agent_run_v1_organizations__org_id__agent_run_post", + "parameters": [ + { + "name": "org_id", + "in": "path", + "required": true, + "schema": { "type": "integer", "title": "Org Id" } + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "title": "Authorization" } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/CreateAgentRunInput" } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/AgentRunResponse" } + } + } + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIRateLimitErrorResponse" + } + } + }, + "description": "Too Many Requests" + }, + "402": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentRunLimitReachedErrorResponse" + } + } + }, + "description": "Payment Required" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionsErrorResponse" + } + } + }, + "description": "Forbidden" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + } + } + }, + "/v1/organizations/{org_id}/agent/run/{agent_run_id}": { + "get": { + "tags": ["agents", "agents", "agents"], + "summary": "Get Agent Run", + "description": "Retrieve the status and result of an agent run.\n\nReturns the current status, progress, and any available results for the specified agent run.\nThe agent run must belong to the specified organization. If the agent run is still in progress,\nthis endpoint can be polled to check for completion.\n\nRate limit: 60 requests per 30 seconds.", + "operationId": "get_agent_run_v1_organizations__org_id__agent_run__agent_run_id__get", + "parameters": [ + { + "name": "agent_run_id", + "in": "path", + "required": true, + "schema": { "type": "integer", "title": "Agent Run Id" } + }, + { + "name": "org_id", + "in": "path", + "required": true, + "schema": { "type": "integer", "title": "Org Id" } + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "title": "Authorization" } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/AgentRunResponse" } + } + } + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIRateLimitErrorResponse" + } + } + }, + "description": "Too Many Requests" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionsErrorResponse" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentRunNotFoundErrorResponse" + } + } + }, + "description": "Not Found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + } + } + }, + "/v1/organizations": { + "get": { + "tags": ["organizations", "organizations", "organizations"], + "summary": "Get Organizations", + "description": "Get organizations for the authenticated user.\n\nReturns a paginated list of all organizations that the authenticated user is a member of.\nResults include basic organization details such as name, ID, and membership information.\nUse pagination parameters to control the number of results returned.\n\nRate limit: 60 requests per 30 seconds.", + "operationId": "get_organizations_v1_organizations_get", + "parameters": [ + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 0, + "default": 0, + "title": "Skip" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 1, + "default": 100, + "title": "Limit" + } + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { "title": "Authorization" } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Page_OrganizationResponse_" + } + } + } + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIRateLimitErrorResponse" + } + } + }, + "description": "Too Many Requests" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "APIRateLimitErrorResponse": { + "properties": { + "message": { + "type": "string", + "title": "Message", + "default": "Rate limit exceeded. Please try again later." + }, + "status_code": { + "type": "integer", + "title": "Status Code", + "default": 429 + } + }, + "type": "object", + "title": "APIRateLimitErrorResponse" + }, + "AgentRunLimitReachedErrorResponse": { + "properties": { + "message": { + "type": "string", + "title": "Message", + "default": "Alloted agent runs for the current billing plan have been reached. Please upgrade your plan to continue." + }, + "status_code": { + "type": "integer", + "title": "Status Code", + "default": 402 + } + }, + "type": "object", + "title": "AgentRunLimitReachedErrorResponse" + }, + "AgentRunNotFoundErrorResponse": { + "properties": { + "message": { + "type": "string", + "title": "Message", + "default": "Agent run not found." + }, + "status_code": { + "type": "integer", + "title": "Status Code", + "default": 404 + } + }, + "type": "object", + "title": "AgentRunNotFoundErrorResponse" + }, + "AgentRunResponse": { + "properties": { + "id": { "type": "integer", "title": "Id" }, + "organization_id": { "type": "integer", "title": "Organization Id" }, + "status": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Status" + }, + "created_at": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Created At" + }, + "web_url": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Web Url" + }, + "result": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Result" + } + }, + "type": "object", + "required": ["id", "organization_id"], + "title": "AgentRunResponse", + "description": "Represents an agent run in API responses" + }, + "CreateAgentRunInput": { + "properties": { "prompt": { "type": "string", "title": "Prompt" } }, + "type": "object", + "required": ["prompt"], + "title": "CreateAgentRunInput" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { "$ref": "#/components/schemas/ValidationError" }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "OrganizationResponse": { + "properties": { + "id": { "type": "integer", "title": "Id" }, + "name": { "type": "string", "title": "Name" }, + "settings": { "$ref": "#/components/schemas/OrganizationSettings" } + }, + "type": "object", + "required": ["id", "name", "settings"], + "title": "OrganizationResponse", + "description": "Represents an organization in API responses" + }, + "OrganizationSettings": { + "properties": { + "enable_pr_creation": { + "type": "boolean", + "title": "Enable Pr Creation", + "default": true + }, + "enable_rules_detection": { + "type": "boolean", + "title": "Enable Rules Detection", + "default": true + } + }, + "type": "object", + "title": "OrganizationSettings" + }, + "Page_OrganizationResponse_": { + "properties": { + "items": { + "items": { "$ref": "#/components/schemas/OrganizationResponse" }, + "type": "array", + "title": "Items" + }, + "total": { "type": "integer", "title": "Total" }, + "page": { "type": "integer", "title": "Page" }, + "size": { "type": "integer", "title": "Size" }, + "pages": { "type": "integer", "title": "Pages" } + }, + "type": "object", + "required": ["items", "total", "page", "size", "pages"], + "title": "Page[OrganizationResponse]" + }, + "Page_UserResponse_": { + "properties": { + "items": { + "items": { "$ref": "#/components/schemas/UserResponse" }, + "type": "array", + "title": "Items" + }, + "total": { "type": "integer", "title": "Total" }, + "page": { "type": "integer", "title": "Page" }, + "size": { "type": "integer", "title": "Size" }, + "pages": { "type": "integer", "title": "Pages" } + }, + "type": "object", + "required": ["items", "total", "page", "size", "pages"], + "title": "Page[UserResponse]" + }, + "PermissionsErrorResponse": { + "properties": { + "message": { + "type": "string", + "title": "Message", + "default": "You do not have access to this organization." + }, + "status_code": { + "type": "integer", + "title": "Status Code", + "default": 403 + } + }, + "type": "object", + "title": "PermissionsErrorResponse" + }, + "UserNotFoundErrorResponse": { + "properties": { + "message": { + "type": "string", + "title": "Message", + "default": "User not found." + }, + "status_code": { + "type": "integer", + "title": "Status Code", + "default": 404 + } + }, + "type": "object", + "title": "UserNotFoundErrorResponse" + }, + "UserResponse": { + "properties": { + "id": { "type": "integer", "title": "Id" }, + "email": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Email" + }, + "github_user_id": { "type": "string", "title": "Github User Id" }, + "github_username": { "type": "string", "title": "Github Username" }, + "avatar_url": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Avatar Url" + }, + "full_name": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "title": "Full Name" + } + }, + "type": "object", + "required": [ + "id", + "email", + "github_user_id", + "github_username", + "avatar_url", + "full_name" + ], + "title": "UserResponse", + "description": "Represents a user in API responses" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { "anyOf": [{ "type": "string" }, { "type": "integer" }] }, + "type": "array", + "title": "Location" + }, + "msg": { "type": "string", "title": "Message" }, + "type": { "type": "string", "title": "Error Type" } + }, + "type": "object", + "required": ["loc", "msg", "type"], + "title": "ValidationError" + } + } + } +} diff --git a/docs/docs.json b/docs/docs.json new file mode 100644 index 000000000..8333377c8 --- /dev/null +++ b/docs/docs.json @@ -0,0 +1,113 @@ +{ + "$schema": "https://mintlify.com/docs.json", + "theme": "mint", + "name": "Codegen", + "colors": { + "primary": "#a277ff", + "light": "#a277ff", + "dark": "#a277ff" + }, + "favicon": "/favicon.svg", + "navigation": { + "tabs": [ + { + "tab": "Documentation", + "groups": [ + { + "group": "Introduction", + "pages": [ + "introduction/overview", + "introduction/capabilities", + "introduction/api", + "introduction/prompting", + "introduction/community", + "introduction/about", + "introduction/faq" + ] + }, + { + "group": "Integrations", + "pages": [ + "integrations/slack", + "integrations/linear", + "integrations/github", + "integrations/web-search", + "integrations/sandboxes" + ] + } + ] + }, + { + "tab": "API Reference", + "groups": [ + { + "group": "Endpoints", + "openapi": { + "source": "/api-reference/openapi3.json", + "directory": "api-reference" + } + } + ] + }, + { + "tab": "Blog", + "groups": [ + { + "group": "Blog", + "pages": ["blog/posts", "blog/devin", "blog/act-via-code"] + } + ] + }, + { + "tab": "Changelog", + "groups": [ + { + "group": "Changelog", + "pages": ["changelog/changelog"] + } + ] + } + ] + }, + "logo": { + "light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg", + "dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg" + }, + "appearance": { + "default": "dark" + }, + "background": { + "decoration": "gradient" + }, + "navbar": { + "primary": { + "type": "button", + "label": "GitHub", + "href": "https://github.com/codegen-sh/codegen-sdk" + } + }, + "seo": { + "metatags": { + "og:site_name": "Codegen", + "og:title": "Codegen - The SWE that Never Sleeps", + "og:description": "Code agents accessible via API, Slack, Linear, Github, and more.", + "og:url": "https://docs.codegen.com", + "og:locale": "en_US", + "og:logo": "https://i.imgur.com/f4OVOqI.png", + "article:publisher": "Codegen, Inc.", + "twitter:site": "@codegen" + }, + "indexing": "navigable" + }, + "footer": { + "socials": { + "x": "https://x.com/codegen", + "linkedin": "https://linkedin.com/company/codegen-dot-com" + } + }, + "integrations": { + "posthog": { + "apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso" + } + } +} diff --git a/docs/mint.json b/docs/mint.json deleted file mode 100644 index 60d2f09a3..000000000 --- a/docs/mint.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "$schema": "https://mintlify.com/schema.json", - "name": "Codegen", - "logo": { - "dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg", - "light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg" - }, - "modeToggle": { - "default": "dark" - }, - "metadata": { - "og:site_name": "Codegen", - "og:title": "Codegen - The SWE that Never Sleeps", - "og:description": "Code agents accessible via API, Slack, Linear, Github, and more.", - "og:url": "https://docs.codegen.com", - "og:locale": "en_US", - "og:logo": "https://i.imgur.com/f4OVOqI.png", - "article:publisher": "Codegen, Inc.", - "twitter:site": "@codegen" - }, - "favicon": "/favicon.svg", - "colors": { - "primary": "#a277ff", - "light": "#a277ff", - "dark": "#a277ff", - "anchors": { - "from": "#61ffca", - "to": "#61ffca" - } - }, - "theme": "prism", - "background": { - "style": "gradient" - }, - "analytics": { - "posthog": { - "apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso" - } - }, - "feedback": { - "thumbsRating": true - }, - "topbarCtaButton": { - "name": "GitHub", - "url": "https://github.com/codegen-sh/codegen-sdk" - }, - "tabs": [ - { - "name": "API Reference", - "openapi": "https://codegen-sh--rest-api.modal.run/api/openapi.json", - "url": "/api-reference" - }, - { - "name": "Blog", - "url": "/blog" - }, - { - "name": "Changelog", - "url": "/changelog" - }, - { - "name": "Graph-sitter", - "url": "/graph-sitter" - } - ], - "navigation": [ - { - "group": "Introduction", - "pages": [ - "introduction/overview", - "introduction/capabilities", - "introduction/api", - "introduction/prompting", - "introduction/community", - "introduction/about", - "introduction/faq" - ] - }, - { - "group": "Integrations", - "pages": [ - "integrations/slack", - "integrations/linear", - "integrations/github", - "integrations/web-search", - "integrations/sandboxes" - ] - }, - { - "group": "Changelog", - "pages": ["changelog/changelog"] - }, - { - "group": "Blog", - "pages": ["blog/posts", "blog/devin", "blog/act-via-code"] - } - ], - "footerSocials": { - "x": "https://x.com/codegen", - "linkedin": "https://linkedin.com/company/codegen-dot-com" - } -} diff --git a/docs/organizations/get-organizations.mdx b/docs/organizations/get-organizations.mdx new file mode 100644 index 000000000..fb20cdd62 --- /dev/null +++ b/docs/organizations/get-organizations.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /v1/organizations +--- \ No newline at end of file diff --git a/docs/users/get-user.mdx b/docs/users/get-user.mdx new file mode 100644 index 000000000..8fde95c28 --- /dev/null +++ b/docs/users/get-user.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /v1/organizations/{org_id}/users/{user_id} +--- \ No newline at end of file diff --git a/docs/users/get-users.mdx b/docs/users/get-users.mdx new file mode 100644 index 000000000..8448ef000 --- /dev/null +++ b/docs/users/get-users.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /v1/organizations/{org_id}/users +--- \ No newline at end of file