Skip to main content

Projects API

Manage your project and members programmatically.

API Naming

In the API, projects are referred to as "teams" (/api/teams) for backward compatibility. The API endpoints and parameter names (e.g., teamId) remain unchanged.

Endpoints Overview

MethodEndpointDescription
POST/api/teamsCreate a new project
GET/api/teamsGet all projects for current user
GET/api/teams/:idGet project by ID
PUT/api/teams/:idUpdate project settings
DELETE/api/teams/:idDelete project
GET/api/teams/membersList project members
POST/api/teams/members/inviteInvite new member
DELETE/api/teams/members/:idRemove member
PATCH/api/teams/members/:id/roleUpdate member role
GET/api/teams/invitations/myGet my pending invitations
POST/api/teams/invitations/:id/acceptAccept invitation
POST/api/teams/invitations/:id/rejectReject invitation
DELETE/api/teams/members/:id/invitationCancel invitation
GET/api/teams/activityGet project activity
note

All project endpoints require JWT authentication.


Create Project

POST /api/teams

Create a new project with the authenticated user as owner.

Request Body

FieldTypeRequiredDescription
namestringYesProject name
slugstringNoURL-friendly project identifier

Response

{
"id": "team_abc123",
"name": "Acme Corporation",
"slug": "acme-corp",
"createdAt": "2024-06-01T00:00:00Z"
}

Get User Projects

GET /api/teams

Get all projects where the user is an owner or member, including their personal project.

Response

{
"data": [
{
"id": "team_abc123",
"name": "Acme Corporation",
"slug": "acme-corp",
"isPersonal": false,
"role": "owner",
"memberCount": 5,
"createdAt": "2024-06-01T00:00:00Z"
}
]
}

Example

curl https://api.rynko.dev/api/teams \
-H "Authorization: Bearer <jwt_token>"

Get Project by ID

GET /api/teams/:id

Get details about a specific project.

Path Parameters

ParameterTypeDescription
idstringProject ID (referred to as teamId in the API)

Response

{
"id": "team_abc123",
"name": "Acme Corporation",
"slug": "acme-corp",
"memberCount": 5,
"createdAt": "2024-06-01T00:00:00Z"
}

Update Project

PUT /api/teams/:id

Update project settings. Only project owner can update.

Path Parameters

ParameterTypeDescription
idstringProject ID (referred to as teamId in the API)

Request Body

FieldTypeRequiredDescription
namestringNoProject name

Response

Returns the updated project object.

Example

curl -X PUT https://api.rynko.dev/api/teams/team_abc123 \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corporation Updated"
}'

Delete Project

DELETE /api/teams/:id

Soft delete a project. Only project owner can delete.

warning

Personal projects cannot be deleted via API - they are automatically deleted when the user account is deleted.

Path Parameters

ParameterTypeDescription
idstringProject ID (referred to as teamId in the API)

Response

{
"message": "Project deleted successfully"
}

List Project Members

GET /api/teams/members

Get all members of the current user's project.

Response

{
"data": [
{
"id": "user_abc123",
"email": "john@acme.com",
"name": "John Doe",
"role": "owner",
"joinedAt": "2024-06-01T00:00:00Z"
},
{
"id": "user_def456",
"email": "jane@acme.com",
"name": "Jane Smith",
"role": "admin",
"joinedAt": "2024-07-15T00:00:00Z"
}
]
}

Member Roles

RoleDescription
ownerFull access, can delete project
adminFull access except project deletion
memberCan create and use templates
viewerRead-only access

Example

curl https://api.rynko.dev/api/teams/members \
-H "Authorization: Bearer <jwt_token>"

Invite Member

POST /api/teams/members/invite

Send an invitation to join your project.

Request Body

FieldTypeRequiredDescription
emailstringYesEmail address to invite
rolestringNoRole to assign (default: member)

Request Example

{
"email": "newmember@acme.com",
"role": "member"
}

Response

{
"id": "invite_abc123",
"email": "newmember@acme.com",
"role": "member",
"status": "pending",
"expiresAt": "2025-01-22T00:00:00Z"
}

Remove Member

DELETE /api/teams/members/:id

Remove a member from your project. Only project owner can remove members.

Path Parameters

ParameterTypeDescription
idstringMember user ID

Response

{
"message": "Member removed successfully"
}

Update Member Role

PATCH /api/teams/members/:id/role

Change a member's role. Only project owner can update roles.

Path Parameters

ParameterTypeDescription
idstringMember user ID

Request Body

FieldTypeRequiredDescription
rolestringYesNew role: admin, member, or viewer

Response

Returns the updated member object.

Example

curl -X PATCH https://api.rynko.dev/api/teams/members/user_def456/role \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"role": "admin"
}'

Get My Invitations

GET /api/teams/invitations/my

Get all pending project invitations for the current user.

Response

{
"data": [
{
"id": "invite_abc123",
"teamId": "team_xyz789",
"teamName": "Acme Corporation",
"role": "member",
"invitedBy": "john@acme.com",
"expiresAt": "2025-01-22T00:00:00Z"
}
]
}

Accept Invitation

POST /api/teams/invitations/:id/accept

Accept a pending project invitation.

Path Parameters

ParameterTypeDescription
idstringInvitation ID

Response

{
"message": "Invitation accepted successfully"
}

Reject Invitation

POST /api/teams/invitations/:id/reject

Reject a pending project invitation.

Path Parameters

ParameterTypeDescription
idstringInvitation ID

Response

{
"message": "Invitation rejected successfully"
}

Cancel Invitation

DELETE /api/teams/members/:id/invitation

Cancel a pending invitation. Only project owner can cancel.

Path Parameters

ParameterTypeDescription
idstringInvitation ID

Response

{
"message": "Invitation cancelled successfully"
}

Get Project Activity

GET /api/teams/activity

Get recent activity for the current user's project.

Response

{
"data": [
{
"type": "member_joined",
"user": "Jane Smith",
"timestamp": "2024-07-15T00:00:00Z"
},
{
"type": "template_created",
"template": "Invoice Template",
"user": "John Doe",
"timestamp": "2024-06-15T00:00:00Z"
}
]
}

Error Codes

CodeDescription
ERR_TEAM_001Project not found
ERR_TEAM_002A project with this slug already exists
ERR_TEAM_003You are not the owner of this project
ERR_TEAM_004Personal projects cannot be deleted directly
ERR_TEAM_005Personal project slug cannot be changed
ERR_TEAM_006This is not a personal project
ERR_TEAM_007User is already a member of this project
ERR_TEAM_008An invitation has already been sent to this user
ERR_TEAM_009Invitation not found
ERR_TEAM_010This invitation has expired
ERR_TEAM_011Project member not found
ERR_TEAM_012You cannot remove yourself from the project

Related: Project Management | Users API