Skip to content

App users

app-users


POST /api/v1/applications/{application_id}/users

Create App User (beta)

Description

Beta. This endpoint is in beta and is subject to breaking changes. If you plan to use it in production, email [email protected] before you integrate, so we can tell you about changes in advance and help you migrate.

Create a user that belongs to your app.

The user gets your app's default scopes, so you can mint a token for them right away (POST .../users/{user_id}/token). An email, if given, is unverified until the person confirms it through the message SweatStack sends; external_reference is your own id for the user, unique within your app, and a way to find them again. Requires that you accepted the developer terms and the Data Processing Agreement for the app on its Consent screen tab.

Input parameters

Parameter In Type Default Nullable Description
HTTPBasic header string N/A No Basic authentication
application_id path string No

Request body

{
    "first_name": "string",
    "last_name": null,
    "email": null,
    "external_reference": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "first_name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "First Name"
        },
        "last_name": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 100
                },
                {
                    "type": "null"
                }
            ],
            "title": "Last Name"
        },
        "email": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "email"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Email"
        },
        "external_reference": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 200,
                    "minLength": 1
                },
                {
                    "type": "null"
                }
            ],
            "title": "External Reference"
        }
    },
    "type": "object",
    "required": [
        "first_name"
    ],
    "title": "AppManagedUserCreate",
    "description": "A user an app creates for itself (plan 082, the management API). The email, if given, is\nunverified until the athlete confirms it; `external_reference` is the app's own id for the\nuser, unique within the app."
}

Responses

{
    "id": "string",
    "first_name": null,
    "last_name": null,
    "email": null,
    "email_verified": true,
    "external_reference": null,
    "registered_at": "2022-04-13T15:42:05.901Z"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "title": "Id"
        },
        "first_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "First Name"
        },
        "last_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Last Name"
        },
        "email": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Email"
        },
        "email_verified": {
            "type": "boolean",
            "title": "Email Verified"
        },
        "external_reference": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "External Reference"
        },
        "registered_at": {
            "type": "string",
            "format": "date-time",
            "title": "Registered At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "first_name",
        "last_name",
        "email",
        "email_verified",
        "external_reference",
        "registered_at"
    ],
    "title": "AppManagedUserResponse"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/applications/{application_id}/users

List App Users (beta)

Description

Beta. This endpoint is in beta and is subject to breaking changes. If you plan to use it in production, email [email protected] before you integrate, so we can tell you about changes in advance and help you migrate.

The users that belong to your app, oldest first.

Input parameters

Parameter In Type Default Nullable Description
HTTPBasic header string N/A No Basic authentication
application_id path string No
email query No Only the user with this email address.
external_reference query No Only the user with this reference of yours.

Responses

[
    {
        "id": "string",
        "first_name": null,
        "last_name": null,
        "email": null,
        "email_verified": true,
        "external_reference": null,
        "registered_at": "2022-04-13T15:42:05.901Z"
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/AppManagedUserResponse"
    },
    "title": "Response List App Users Api V1 Applications  Application Id  Users Get"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/applications/{application_id}/users/{user_id}

Get App User (beta)

Description

Beta. This endpoint is in beta and is subject to breaking changes. If you plan to use it in production, email [email protected] before you integrate, so we can tell you about changes in advance and help you migrate.

One user of your app.

Input parameters

Parameter In Type Default Nullable Description
HTTPBasic header string N/A No Basic authentication
application_id path string No
user_id path string No

Responses

{
    "id": "string",
    "first_name": null,
    "last_name": null,
    "email": null,
    "email_verified": true,
    "external_reference": null,
    "registered_at": "2022-04-13T15:42:05.901Z"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "title": "Id"
        },
        "first_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "First Name"
        },
        "last_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Last Name"
        },
        "email": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Email"
        },
        "email_verified": {
            "type": "boolean",
            "title": "Email Verified"
        },
        "external_reference": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "External Reference"
        },
        "registered_at": {
            "type": "string",
            "format": "date-time",
            "title": "Registered At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "first_name",
        "last_name",
        "email",
        "email_verified",
        "external_reference",
        "registered_at"
    ],
    "title": "AppManagedUserResponse"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

PATCH /api/v1/applications/{application_id}/users/{user_id}

Update App User (beta)

Description

Beta. This endpoint is in beta and is subject to breaking changes. If you plan to use it in production, email [email protected] before you integrate, so we can tell you about changes in advance and help you migrate.

Change a user's name. An email address is changed through SweatStack support.

Input parameters

Parameter In Type Default Nullable Description
HTTPBasic header string N/A No Basic authentication
application_id path string No
user_id path string No

Request body

{
    "first_name": null,
    "last_name": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "first_name": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 100,
                    "minLength": 1
                },
                {
                    "type": "null"
                }
            ],
            "title": "First Name"
        },
        "last_name": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 100
                },
                {
                    "type": "null"
                }
            ],
            "title": "Last Name"
        }
    },
    "type": "object",
    "title": "AppManagedUserUpdate",
    "description": "The name only (plan 082 D19): an email change goes through support."
}

Responses

{
    "id": "string",
    "first_name": null,
    "last_name": null,
    "email": null,
    "email_verified": true,
    "external_reference": null,
    "registered_at": "2022-04-13T15:42:05.901Z"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "title": "Id"
        },
        "first_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "First Name"
        },
        "last_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Last Name"
        },
        "email": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Email"
        },
        "email_verified": {
            "type": "boolean",
            "title": "Email Verified"
        },
        "external_reference": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "External Reference"
        },
        "registered_at": {
            "type": "string",
            "format": "date-time",
            "title": "Registered At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "first_name",
        "last_name",
        "email",
        "email_verified",
        "external_reference",
        "registered_at"
    ],
    "title": "AppManagedUserResponse"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

DELETE /api/v1/applications/{application_id}/users/{user_id}

Delete App User (beta)

Description

Beta. This endpoint is in beta and is subject to breaking changes. If you plan to use it in production, email [email protected] before you integrate, so we can tell you about changes in advance and help you migrate.

Delete a user of your app and all their data. Irreversible.

Input parameters

Parameter In Type Default Nullable Description
HTTPBasic header string N/A No Basic authentication
application_id path string No
user_id path string No

Responses

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/applications/{application_id}/users/{user_id}/token

Mint App User Token (beta)

Description

Beta. This endpoint is in beta and is subject to breaking changes. If you plan to use it in production, email [email protected] before you integrate, so we can tell you about changes in advance and help you migrate.

A token for one of your users, exactly what the token endpoint returns after a code exchange: an access token and a refresh token with your app's scopes on this user. Refresh it at POST /oauth/token with your client credentials, as any other.

Input parameters

Parameter In Type Default Nullable Description
HTTPBasic header string N/A No Basic authentication
application_id path string No
user_id path string No

Responses

{
    "access_token": "string",
    "token_type": "string",
    "expires_in": 0,
    "refresh_token": null,
    "scope": null,
    "id_token": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "access_token": {
            "type": "string",
            "title": "Access Token"
        },
        "token_type": {
            "type": "string",
            "const": "Bearer",
            "title": "Token Type",
            "default": "Bearer"
        },
        "expires_in": {
            "type": "integer",
            "title": "Expires In"
        },
        "refresh_token": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Refresh Token"
        },
        "scope": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Scope"
        },
        "id_token": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Id Token"
        }
    },
    "type": "object",
    "required": [
        "access_token",
        "expires_in"
    ],
    "title": "TokenResponse"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

Schemas

AppManagedUserCreate

Name Type Description
email
external_reference
first_name string
last_name

AppManagedUserResponse

Name Type Description
email
email_verified boolean
external_reference
first_name
id string
last_name
registered_at string(date-time)

AppManagedUserUpdate

Name Type Description
first_name
last_name

HTTPValidationError

Name Type Description
detail Array<ValidationError>

TokenResponse

Name Type Description
access_token string
expires_in integer
id_token
refresh_token
scope
token_type string

ValidationError

Name Type Description
loc Array<>
msg string
type string

Security schemes

Name Type Scheme Description
HTTPBearer http bearer
HTTPBasic http basic