Skip to main content

Authentication

POST Enable/Disable OAuth

https://api.track.toggl.com/api/v9/me/enable_oauth/{provider}

Enable/Disable login using user's provider account to existing Toggl account.

curl -X POST https://api.track.toggl.com/api/v9/me/enable_oauth/{provider} \
-H "Content-Type: application/json" \
-d '{"code":"string","enabled":"boolean","token":"string"}' \
-u <email>:<password>

Parameters

Query

nametyperequireddescription
errorstringfalseError

Body

nametypedescription
codestringOAuth code
enabledbooleanWhether to enable or disable OAuth
tokenstringOAuth token

Response

Successful operation.

POST ResetToken

https://api.track.toggl.com/api/v9/me/reset_token

Resets API token for the current user.

curl -X POST https://api.track.toggl.com/api/v9/me/reset_token \
-H "Content-Type: application/json" \
-u <email>:<password>

Response

Successful operation.

POST Create session

https://api.track.toggl.com/api/v9/me/sessions

Creates a session and sets a cookie in the response header which can be used for authentication in API requests

curl -X POST https://api.track.toggl.com/api/v9/me/sessions \
-H "Content-Type: application/json" \
-d '{"remember_me":"boolean"}'

Parameters

Body

nametypedescription
remember_mebooleanIf true, the session cookie will be valid for 24 hours, otherwise until the browser is closed

Response

{
"api_token": {
"description": "will be omitted if empty",
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"fullname": {
"type": "string"
},
"id": {
"type": "integer"
},
"timezone": {
"type": "string"
}
}

DELETE Delete session

https://api.track.toggl.com/api/v9/me/sessions

Deletes a session used for authenticating the current request

curl -X DELETE https://api.track.toggl.com/api/v9/me/sessions \
-H "Content-Type: application/json"

Response

POST Signup

https://api.track.toggl.com/api/v9/signup

Sign up as a new user.

curl -X POST https://api.track.toggl.com/api/v9/signup \
-H "Content-Type: application/json" \
-d '{"code":"string","country_id":"integer","created_with":"string","email":"string","full_name":"string","google_access_token":"string","invitation_code":"string","password":"string","provider":"string","timezone":"string","token":"string","tos_accepted":"boolean","workspace":{"initial_pricing_plan":"integer","name":"string"}}'

Parameters

Body

nametypedescription
codestringRequired if signing up via OAuth
country_idintegerUser's country ID, if not provided will be United States
created_withstringShould describe the application/service that is using the API
emailstringEmail for new user account
full_namestringUser's full name, if not provided will be derived from the email address
google_access_tokenstringLegacy field
invitation_codestringOptional, used when creating account through an invitation
passwordstringPassword for new user account
providerstringRequired if signing up via OAuth
timezonestringUser's timezone, if not provided will be UTC
tokenstringRequired if signing up via OAuth
tos_acceptedbooleanWhether the Terms of Service have been accepted
workspace
nametypedescription
initial_pricing_planintegerPlan ID for the new workspace
namestringWorkspace name, if not provided it will be based on the user's full name
Optional workspace settings, used when creating account not through an invitation

Response

{
"api_token": {
"description": "will be omitted if empty",
"type": "string"
},
"at": {
"type": "string",
"format": "date-time"
},
"beginning_of_week": {
"type": "integer"
},
"country_id": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"default_workspace_id": {
"type": "integer"
},
"email": {
"type": "string",
"format": "email"
},
"fullname": {
"type": "string"
},
"id": {
"type": "integer"
},
"image_url": {
"type": "string",
"example": "http://example.com"
},
"intercom_hash": {
"description": "will be omitted if empty",
"type": "string"
},
"openid_email": {
"type": "string",
"format": "email"
},
"openid_enabled": {
"type": "boolean"
},
"options": {
"object": {
"additionalProperties": "object"
},
"description": "will be omitted if empty"
},
"timezone": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
© 2022 Toggl. All rights reserved.