Skip to content

Commit 91c48d4

Browse files
snopokeclaude
andcommitted
update docs for simplified project API key auth
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a129d89 commit 91c48d4

File tree

5 files changed

+48
-50
lines changed

5 files changed

+48
-50
lines changed

docs/basics.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@ title: Using the API
33
---
44
# Using the Task Badger API
55

6-
## Organization and Project
6+
## Authentication
77

8-
API endpoints include both the `organization` and `project` slug. The user authenticating
9-
the request must have access to both for the request to be accepted.
8+
API requests must be authenticated using a **Project API Key** provided in the
9+
`Authorization` header as a Bearer token.
1010

11-
* Organization slug
12-
* You can get this by going to 'My Organization'
13-
* Project slug
14-
* Go to the 'Projects' page. The slug for each project is listed.
11+
You can find your API key on the project settings page in the
12+
[Task Badger dashboard](https://taskbadger.net). A default API key is created
13+
automatically when you create a new organization.
1514

16-
## Authentication
17-
18-
Requests must be authenticated by providing a bearer token provided
19-
in the Authentication header. You can generate a token by going to your
20-
[user profile page](https://taskbadger.net/users/profile/).
15+
The API key encodes your organization and project, so you don't need to
16+
configure them separately.
2117

2218
```linenums="1" hl_lines="2"
2319
POST https://taskbadger.net/api/{organization}/{project}/tasks/
@@ -26,6 +22,17 @@ Content-type: application/json
2622
{"name":"demo task","status":"pending"}
2723
```
2824

25+
## Organization and Project
26+
27+
API endpoints include both the `organization` and `project` slug. When using
28+
a Project API Key with the Python SDK or CLI, these are detected automatically
29+
from the key.
30+
31+
If you need to find them manually:
32+
33+
* **Organization slug** — available on the 'My Organization' page
34+
* **Project slug** — listed on the 'Projects' page
35+
2936
## Request bodies
3037

3138
The payload of HTTP POST requests must be specified as JSON.

docs/cli.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Values provided via environment variables override values in the configuration f
8888
and values provided via the command line override both environment config and the
8989
configuration file.
9090

91-
Details about the configuration parameters can be found [here](basics.md#organization-and-project)
91+
Details about authentication can be found [here](basics.md#authentication).
9292

9393
### Command line arguments
9494

@@ -113,24 +113,26 @@ of the API Key.
113113

114114
### Environment variables
115115

116-
Use the following environment variable names to configure the CLI:
116+
Use the following environment variable to configure the CLI:
117+
118+
* `TASKBADGER_API_KEY` — Project API key (organization and project are detected automatically)
119+
120+
When using a legacy API key, the following additional variables are required:
117121

118-
* `TASKBADGER_API_KEY`
119122
* `TASKBADGER_ORG`
120123
* `TASKBADGER_PROJECT`
121124

122125
### Configuration file
123126

124127
The CLI includes a convenience command to create the configuration file. Running the `configure`
125-
command will prompt you for the configuration parameters and save them to the configuration
126-
file.
128+
command will prompt you for your API key. If you provide a Project API Key, the organization
129+
and project are detected automatically.
127130

128131
```bash
129132
$ taskbadger configure
130133

131-
Organization slug: my-org
132-
Project slug: project-x
133-
API Key: XYZ.ABC
134+
API Key: YOUR_API_KEY
135+
Project key detected — organization: my-org, project: project-x
134136

135137
Config written to ~/.config/taskbadger/config
136138
```

docs/python-celery.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ import taskbadger
2222
from taskbadger.systems import CelerySystemIntegration
2323

2424
taskbadger.init(
25-
organization_slug="my-org",
26-
project_slug="my-project",
27-
token="***",
25+
token="YOUR_API_KEY",
2826
systems=[CelerySystemIntegration()],
2927
tags={"environment": "production"}
3028
)

docs/python.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ The SDK must be configured before you can use it to interact with the APIs.
1818
import taskbadger
1919

2020
taskbadger.init(
21-
organization_slug="my-org",
22-
project_slug="my-project",
23-
token="***",
21+
token="YOUR_API_KEY",
2422
tags={"environment": "production"},
2523
)
2624
```
2725

28-
Details about the slug configuration parameters can be found [here](basics.md#organization-and-project).
26+
When using a Project API Key, the organization and project are detected
27+
automatically from the key. You can find your API key on the project settings
28+
page in the [Task Badger dashboard](https://taskbadger.net).
2929

3030
| Name | Description |
3131
|-------------------|-----------------------------------------------------------------------------------------------------------|
32-
| organization_slug | The organization identifier. |
33-
| project_slug | The project identifier. |
34-
| token | API authentication token. |
32+
| token | Project API key. The organization and project are extracted from the key automatically. |
3533
| tags | Global tags which are added to all tasks. |
3634
| systems | System integrations such as [Celery](python-celery.md) |
3735
| before_create | A function that is called before a task is created. See [Before Create Callback](#before-create-callback) |
36+
| organization_slug | The organization identifier. Only required for legacy API keys. |
37+
| project_slug | The project identifier. Only required for legacy API keys. |
3838

3939
If you attempt to use the SDK without configuring it you will get an error. To avoid this you can use the
4040
[safe functions](#safe-functions) which will log any errors to the `taskbadger` logger.

docs/quick.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@ Let's discover **Task Badger in less than 5 minutes**.
77

88
## Setup
99

10-
In order to use the API you will need the following details:
11-
12-
* Organization slug
13-
* You can get this by going to 'My Organization'
14-
* Project slug
15-
* Go to the 'Projects' page. The slug for each project is listed.
16-
* API Key
17-
* Create one on your Profile page
10+
To get started you will need a **Project API Key**. You can find this on
11+
the project settings page in the [Task Badger dashboard](https://taskbadger.net).
12+
A default key is created automatically when you create a new organization.
1813

1914

2015
## Montior Celery Tasks
@@ -29,9 +24,7 @@ from taskbadger.systems.celery import CelerySystemIntegration
2924
app = Celery('hello', broker='amqp://guest@localhost//')
3025

3126
taskbadger.init(
32-
organization_slug="my-org",
33-
project_slug="my-project",
34-
token="***",
27+
token="YOUR_API_KEY",
3528
tags={"environment": "production"},
3629
systems=[CelerySystemIntegration(record_task_args=True)]
3730
)
@@ -55,11 +48,10 @@ $ python3 -m pip install taskbadger
5548

5649
$ taskbadger configure
5750

58-
Organization slug: my-org
59-
Project slug: project-x
60-
API Key: XYZ.ABC
51+
API Key: YOUR_API_KEY
52+
Project key detected — organization: my-org, project: project-x
6153

62-
Config written to ~/.config/taskbadger/confi
54+
Config written to ~/.config/taskbadger/config
6355
```
6456

6557
### Use the CLI to run and monitor the command
@@ -94,21 +86,20 @@ See more about the [CLI](cli.md).
9486
import taskbadger
9587

9688
taskbadger.init(
97-
organization_slug="my-org",
98-
project_slug="my-project",
99-
token="***",
89+
token="YOUR_API_KEY",
10090
tags={"environment": "production"},
10191
)
10292
```
10393

10494
=== "Shell"
10595

106-
Export the configuration parameters:
96+
Export the configuration parameters. The organization and project slugs
97+
can be found on the project settings page alongside your API key.
10798

10899
```shell
109100
export ORG="my-org"
110101
export PROJECT="my-project"
111-
export API_KEY="***"
102+
export API_KEY="YOUR_API_KEY"
112103
```
113104

114105
### Creating a task

0 commit comments

Comments
 (0)