Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# build output
dist/


# generated types
.astro/
.idea
Expand Down
12 changes: 11 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,18 @@
[headers.values]
Cache-Control = "public, max-age=86400, s-maxage=86400, stale-while-revalidate=604800"

# Markdown API reference: 1 hour (generated from spec)
# Markdown API references: 1 hour (generated from spec)
[[headers]]
for = "/apis.md"
[headers.values]
Cache-Control = "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400"

[[headers]]
for = "/agentkit/apis.md"
[headers.values]
Cache-Control = "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400"

[[headers]]
for = "/saaskit/apis.md"
[headers.values]
Cache-Control = "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400"
125 changes: 125 additions & 0 deletions openapi/agentkit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
info:
title: AgentKit APIs
description: |
# Overview

The AgentKit API gives your AI agents authenticated access to third-party apps — sending emails, reading calendars, creating tickets, querying databases, and more. Your agent calls a tool; Scalekit handles the OAuth flow, token storage, and API call.

**Base URLs:**

```
https://{your-subdomain}.scalekit.dev (Development)
https://{your-subdomain}.scalekit.com (Production)
```

## Quickstart

### 1. Get an access token

Use your API credentials from the [Scalekit Dashboard](https://app.scalekit.com) → **Developers → Settings → API Credentials**.

```sh
curl -X POST https://<SCALEKIT_ENVIRONMENT_URL>/oauth/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id={client_id}' \
-d 'client_secret={client_secret}' \
-d 'grant_type=client_credentials'
```

### 2. List connected accounts

```sh
curl https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/connected_accounts \
-H 'Authorization: Bearer {access_token}'
```

### 3. Execute a tool on behalf of a user

```sh
curl -X POST https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/execute_tool \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-d '{
"connected_account_id": "{connected_account_id}",
"tool_name": "gmail_fetch_emails",
"tool_input": { "max_results": 5 }
}'
```

## SDKs

```sh
npm install @scalekit-sdk/node # Node.js
pip install scalekit-sdk-python # Python
```

For the full product guide, see the [AgentKit documentation](https://docs.scalekit.com/agentkit/quickstart/).

---

Looking for SSO, SCIM, directory sync, or user management APIs? See the [SaaSKit API reference](https://docs.scalekit.com/saaskit/apis/). For the complete endpoint list across both products, see [All APIs](https://docs.scalekit.com/apis/).
contact:
name: Scalekit Inc
url: https://scalekit.com
email: support@scalekit.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0
version: 1.0.0
paths:
/api/v1/connected_accounts:
$ref: paths/api_v1_connected_accounts.yaml
/api/v1/connected_accounts/auth:
$ref: paths/api_v1_connected_accounts_auth.yaml
/api/v1/connected_accounts/details:
$ref: paths/api_v1_connected_accounts_details.yaml
/api/v1/connected_accounts/magic_link:
$ref: paths/api_v1_connected_accounts_magic_link.yaml
/api/v1/connected_accounts/user/verify:
$ref: paths/api_v1_connected_accounts_user_verify.yaml
/api/v1/connected_accounts:delete:
$ref: paths/api_v1_connected_accounts:delete.yaml
/api/v1/connected_accounts:search:
$ref: paths/api_v1_connected_accounts:search.yaml
/api/v1/execute_tool:
$ref: paths/api_v1_execute_tool.yaml
tags:
- description: >-
Manage connected accounts for third-party integrations and OAuth
connections. Connected accounts represent authenticated access to external
services like Google, Notion, Slack, and other applications.
name: Connected Accounts
externalDocs:
description: AgentKit Docs
url: https://docs.scalekit.com/agentkit/quickstart/
openapi: 3.1.1
servers:
- url: https://$SCALEKIT_ENVIRONMENT_URL
components:
securitySchemes:
oauth2:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://$SCALEKIT_ENVIRONMENT_URL/oauth/token
scopes:
'': No scope required for client credentials flow
security:
- oauth2: []
webhooks:
connected_account.created:
$ref: webhooks/connected_account.created.yaml
connected_account.updated:
$ref: webhooks/connected_account.updated.yaml
connected_account.deleted:
$ref: webhooks/connected_account.deleted.yaml
connected_account.magic_link_generated:
$ref: webhooks/connected_account.magic_link_generated.yaml
connected_account.oauth_tokens_fetched:
$ref: webhooks/connected_account.oauth_tokens_fetched.yaml
connected_account.token_refresh_succeeded:
$ref: webhooks/connected_account.token_refresh_succeeded.yaml
connected_account.token_refresh_failed:
$ref: webhooks/connected_account.token_refresh_failed.yaml
connected_account.oauth_succeeded:
$ref: webhooks/connected_account.oauth_succeeded.yaml
9 changes: 9 additions & 0 deletions openapi/code_samples/go/api_v1_connections/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// List connections by organization id
connections, err := scalekitClient.Connection().ListConnections(
ctx,
organizationId
)

// List connections by domain
connections, err := scalekitClient.Connection().ListConnectionsByDomain(ctx,
domain)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
func main() {
scalekitClient := scalekit.NewScalekitClient(
os.Getenv("SCALEKIT_ENV_URL"),
os.Getenv("SCALEKIT_CLIENT_ID"),
os.Getenv("SCALEKIT_CLIENT_SECRET"),
)
membership := &usersv1.CreateMembership{
Roles: []*usersv1.Role{{Name: "admin"}},
Metadata: map[string]string{
"department": "engineering",
"location": "nyc-office",
},
}
resp,
err := scalekitClient.User().CreateMembership(
context.Background(), "org_123",
"usr_123", membership, false)
if err != nil {
panic(err)
}
}
6 changes: 6 additions & 0 deletions openapi/code_samples/go/api_v1_organizations/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
organizations, err := scalekitClient.Organization.ListOrganizations(
ctx,
&scalekit.ListOrganizationOptions{
PageSize: 10,
}
)
7 changes: 7 additions & 0 deletions openapi/code_samples/go/api_v1_organizations/post.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
organization, err := ScalekitClient.Organization.CreateOrganization(
ctx,
name,
scalekit.CreateOrganizationOptions{
ExternalID: "externalId",
},
)
4 changes: 4 additions & 0 deletions openapi/code_samples/go/api_v1_organizations_{id}/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
err := scalekitClient.Organization.DeleteOrganization(
ctx,
organizationId
)
10 changes: 10 additions & 0 deletions openapi/code_samples/go/api_v1_organizations_{id}/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
scalekitClient := scalekit.NewScalekitClient(
<SCALEKIT_ENVIRONMENT_URL>,
<SCALEKIT_CLIENT_ID>,
<SCALEKIT_CLIENT_SECRET>
)

organization, err := scalekitClient.Organization.GetOrganization(
ctx,
organizationId
)
8 changes: 8 additions & 0 deletions openapi/code_samples/go/api_v1_organizations_{id}/patch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
organization, err := scalekitClient.Organization.UpdateOrganization(
ctx,
organizationId,
&scalekit.UpdateOrganization{
DisplayName: "displayName",
ExternalId: "externalId",
},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
link, err := scalekitClient.Organization.GeneratePortalLink(
ctx,
organizationId
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
settings := OrganizationSettings{

Features: []Feature{

{

Name: "sso",

Enabled: true,

},

{

Name: "dir_sync",

Enabled: true,

},

},

}


organization,err := scalekitClient.Organization().UpdateOrganizationSettings(ctx, organizationId, settings)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resp, err := scalekitClient.Role().ListOrganizationRoles(ctx, "org_123")
if err != nil { /* handle err */ }
_ = resp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resp, err := scalekitClient.Role().CreateOrganizationRole(ctx, "org_123", &rolesv1.CreateOrganizationRole{

Name: "org_admin",

DisplayName: "Org Admin",

Description: proto.String("Organization-scoped role"), // optional

Extends: proto.String("base_role_name"), // optional

Permissions: []string{"perm.read", "perm.write"}, // optional

})
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resp, err := scalekitClient.Role().UpdateDefaultOrganizationRoles(ctx, "org_123", "org_member")
if err != nil { /* handle err */ }
_ = resp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Basic delete
err := scalekitClient.Role().DeleteOrganizationRole(ctx, "org_123", "org_role_admin")
if err != nil { /* handle err */ }

// With reassignment
err = scalekitClient.Role().DeleteOrganizationRole(ctx, "org_123", "org_role_admin", "org_role_member")
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resp, err := scalekitClient.Role().GetOrganizationRole(ctx, "org_123", "org_admin")
if err != nil { /* handle err */ }
_ = resp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resp, err := scalekitClient.Role().UpdateOrganizationRole(ctx, "org_123", "org_admin", &rolesv1.UpdateRole{
DisplayName: "Org Admin (Updated)",
Description: "Updated org role description",
})
if err != nil { /* handle err */ }
_ = resp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
err := scalekitClient.Connection.DeleteConnection(
ctx,
organizationId,
connectionId,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
connection, err := scalekitClient.Connection.GetConnection(
ctx,
organizationId,
connectionId,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
err := scalekitClient.Connection.DisableConnection(
ctx,
organizationId,
connectionId,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
err := scalekitClient.Connection.EnableConnection(
ctx,
organizationId,
connectionId,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
directories,err := scalekitClient.Directory().ListDirectories(ctx, organizationId)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
options := &ListDirectoryGroupsOptions{

PageSize: 10,

PageToken:"",

}


directoryGroups, err := scalekitClient.Directory().ListDirectoryGroups(ctx, organizationId, directoryId, options)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
options := &ListDirectoryUsersOptions{

PageSize: 10,

PageToken: "",

}

directoryUsers,err := scalekitClient.Directory().ListDirectoryUsers(ctx, organizationId, directoryId, options)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
directory, err := scalekitClient.Directory().GetDirectory(ctx, organizationId, directoryId)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable,err := scalekitClient.Directory().DisableDirectory(ctx, organizationId, directoryId)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable,err := scalekitClient.Directory().EnableDirectory(ctx, organizationId, directoryId)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
domains, err := scalekitClient.Domain().ListDomains(ctx, "org_id", &scalekit.ListDomainOptions{
DomainType: "ORGANIZATION_DOMAIN",
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
domain, err := scalekitClient.Domain().CreateDomain(ctx, "org_id", "example.com", &scalekit.CreateDomainOptions{

DomainType: "ORGANIZATION_DOMAIN",

})
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
err = scalekitClient.Domain().DeleteDomain(ctx, "dom_123", "org_123")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
domain, err := scalekitClient.Domain().GetDomain(ctx, "dom_123", "org_123")
Loading