Applications
As the name suggests, applications are a core part of typeauth. On this page, we'll dive into the different application endpoints you can use to manage application programmatically. We'll look at how to create, delete, update, and list applications.
The application model
The application model contains all the information about your applications, such as their name, description, and prefix. It also contains a reference to the account that holds the application and keys underneath.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the application.
- Name
name
- Type
- string
- Description
The username for the application.
- Name
prefix
- Type
- string
- Description
The phone number for the application.
- Name
description
- Type
- string
- Description
The avatar image URL for the contact.
- Name
accId
- Type
- string
- Description
Account ID identifier for the application.
- Name
updatedAt
- Type
- timestamp
- Description
Timestamp of when the application was updated.
- Name
createdAt
- Type
- timestamp
- Description
Timestamp of when the application was created.
List all applications
This endpoint allows you to retrieve a paginated list of all your applications. By default, a maximum of hundred applications are shown per page.
Required attributes
Path parameters
- Name
accountID
- Type
- string
- Description
Account ID where the application is created.
Request
curl -G https://api.typeauth.com/:accountID/applications \
-H "Authorization: Bearer {token}"
Response
{
"succces": true,
"message": "",
"data": [
{
"accId": "KFUEB2_W5SaQ754BUKz4r",
"id": "H-N2eFoWSFN8CGZhFuYGi",
"name": "K8S API",
"description": "desc",
"createdAt": "2024-04-13T02:52:08.470Z",
"updatedAt": "2024-04-13T02:52:08.470Z",
"prefix": "k8s",
"keyCount": 13
},
]
}
Create an application
This endpoint allows you to add a new application or API. To add an application , you must provide their name.
Required attributes
- Name
name
- Type
- string
- Description
The name for the application.
Optional attributes
- Name
description
- Type
- string
- Description
The description for the application.
- Name
prefix
- Type
- string
- Description
The prefix for the keys created under the application.
Request
curl https://api.typeauth.com/:accountID/applications/create \
-H "Authorization: Bearer {token}" \
-d '{
"name": "First Application",
"description": "This is the description",
"prefix": "api1_"
}'
Response
{
"success": true,
"message": "",
"data": [
{
"accId": "KFUEB2_W5SaQ754BUKz4r",
"id": "RSnkZTFTT21hq3k29Wia8",
"name": "First Application",
"description": "This is the description",
"createdAt": "2024-04-14T01:12:41.511Z",
"updatedAt": "2024-04-14T01:12:41.511Z",
"prefix": "api1_"
}
]
}
Get an application by AppID
This endpoint allows you to retrieve an application by providing their Application id. Refer to the list at the top of this page to see which properties are included with application objects.
Request
curl https://api.typeauth.com/:accountID/applications/:applicationID \
-H "Authorization: Bearer {token}"
Response
{
"success": true,
"message": "",
"data": [
{
"accId": "KFUEB2_W5SaQ754BUKz4r",
"id": "H-N2eFoWSFN8CGZhFuYGi",
"name": "K8S API",
"description": "desc",
"createdAt": "2024-04-13T02:52:08.470Z",
"updatedAt": "2024-04-13T02:52:08.470Z",
"prefix": "k8s",
"keyCount": 13
}
]
}
Update an application
This endpoint allows you to perform an update on an application.
Optional attributes
- Name
name
- Type
- string
- Description
The username for the application.
- Name
prefix
- Type
- string
- Description
The phone number for the application.
- Name
description
- Type
- string
- Description
The avatar image URL for the contact.
Request
curl -X PUT https://api.typeauth.com/:accountID/applications/:applicationID \
-H "Authorization: Bearer {token}" \
-d '{
"name": "K8S API Updated",
"description": "Updated Description",
"prefix": "api1_"
}'
Response
{
"success": true,
"message": "",
"data": [
{
"accId": "KFUEB2_W5SaQ754BUKz4r",
"id": "H-N2eFoWSFN8CGZhFuYGi",
"name": "K8S API Updated",
"description": "Updated Description",
"createdAt": "2024-04-13T02:52:08.470Z",
"updatedAt": "2024-04-13T03:55:09.567Z",
"prefix": "api1_",
"keyCount": 13
}
]
}
Delete a contact
This endpoint allows you to delete an application. Note: This will also delete the keys associated to the given application.
Request
curl -X DELETE https://api.typeauth.com/:accountID/applications/:applicationID \
-H "Authorization: Bearer {token}"