Create a goal pre-scoped to This Week or Next Week.
POST
/goals
const url = 'https://api.gospl.example/v1/goals';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"title":"example","description":"example","type":"professional","targetWeek":"this"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.gospl.example/v1/goals \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "title": "example", "description": "example", "type": "professional", "targetWeek": "this" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
title
required
string
description
string
type
required
string
targetWeek
required
Only active columns accept new/moved goals; Previous is read-only.
string
Responses
Section titled “ Responses ”Created.
Media type application/json
object
id
required
string format: uuid
title
required
string
description
string
type
required
string
status
required
string
weekStart
required
Anchors the goal to a week (G2).
string format: date
dateSet
required
string format: date-time
dateCompleted
string format: date-time
Example
{ "type": "professional", "status": "active"}Invalid request.
Media type application/json
object
code
required
string
message
required
string
Example generated
{ "code": "example", "message": "example"}Missing/invalid credentials.
Media type application/json
object
code
required
string
message
required
string
Example generated
{ "code": "example", "message": "example"}