---
title: "Create invite link"
method: POST
path: "/v2/organizations/{organization_id}/invite_links"
tags: ["invite_links"]
---

# Create invite link

`POST /v2/organizations/{organization_id}/invite_links`

## Request

- Base URL: `https://api.hubstaff.com`
- URL: `https://api.hubstaff.com/v2/organizations/{organization_id}/invite_links`
- Auth: OAuth 2
  - Authorization code: `https://account.hubstaff.com/authorizations/new`
  - Token URL: `https://account.hubstaff.com/access_tokens` scopes: `hubstaff:read`, `hubstaff:write`
- TypeScript: <https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/docs/v2/organizations/:organization_id/invite_links/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new invite link. Anyone with the returned url can join the organization.

At least one project or team must be assigned to the link.

Only available to organization owners and managers with the invite members permission.

Available roles:
- project_user - Invited as a project user
- project_viewer - Invited as a project viewer

## Path parameters

- `organization_id` integer, required

## Request body

- PostV2OrganizationsOrganizationIdInviteLinks: Create invite link
  - `name` string, required: The invite link name (unique per organization)
  - `role` 'project_user' | 'project_viewer': The role users joining via the link will be added as
  - `expires_on` string, date: Expiration date (link never expires when omitted)
  - `use_cap` integer: Maximum number of joins allowed (unlimited when omitted)
  - `project_ids` integer[]: List of project IDs users are added to when joining via the link
  - `team_ids` integer[]: List of team IDs users are added to when joining via the link
  - `pay_rate` number, float: A pay rate to set for users joining via the link
  - `enabled` boolean: Whether the link is enabled

## Response `201`

An invite link

- object
  - `invite_link` InviteLink: InviteLink model
    - `id` integer, required: Invite link ID
    - `name` string, required: Invite link name
    - `url` string, uri, required: Shareable invite URL
    - `role` string, required: The role users joining via the link will be added as (project_user or project_viewer). Null when no role is assigned (legacy links)
    - `status` string, required: Invite link status (active, disabled or expired). The expiry cause is derivable from expires_on and use_cap/used_count
    - `enabled` boolean, required: Whether the link is enabled
    - `deletable` boolean, required: Whether the link can be deleted (false for the organization's default link)
    - `expires_on` string, date, required: Expiration date (null means the link never expires)
    - `use_cap` integer, required: Maximum number of joins allowed (null means unlimited)
    - `used_count` integer, required: Number of users who joined via the link
    - `project_ids` integer[], required: Projects users are added to when joining via the link
    - `team_ids` integer[], required: Teams users are added to when joining via the link
    - `pay_rate` string: Pay rate assigned to users joining via the link
    - `created_at` string, date-time, required: When the record was created
    - `updated_at` string, date-time, required: When the record was last updated

## Other responses

- `400`: Invalid parameters
- `401`: Unauthorized
- `403`: API access is only for organizations on an active plan
- `404`: Could not find record
- `429`: Rate limit exceeded

## Changes

- **2026-11-06** `c6b90e4e4bdc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/changes/v2/organizations/:organization_id/invite_links/post.md)

---

[API](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api.md) - [All operations](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/revisions/c6b90e4e4bdc?raw)
