webrecorder / browsertrix

Browsertrix is the hosted, high-fidelity, browser-based crawling service from Webrecorder designed to make web archiving easier and more accessible for all!
https://browsertrix.com
GNU Affero General Public License v3.0
148 stars 29 forks source link

[Feature]: Add new subscriptions API (was: Update org create endpoint to support additional options) #1896

Closed ikreymer closed 1 week ago

ikreymer commented 3 weeks ago

What change would you like to see?

The /api/orgs/create endpoint only allows creation of an org with name/title. To facilitate more automated org creation (such as in response to a user-sign up), the endpoint should be able to accept: org quotas, first user to be invited (but not added), and makes the name / slug optional in the org create API.

To make this cleaner, should add a separate subscriptions API, under /api/subscriptions to manage creating, updating and canceling subscriptions. The /subscriptions/create API will also create the org as described above. The original /api/orgs/create endpoint should stay the same.

Context

This will help the subscription workflow where orgs creation, setting of quotas, inviting of users can all be done in one API call.

tw4l commented 3 weeks ago

By making org name optional, you mean setting something like "[User name]'s Archive" as a default in the endpoint if a name isn't explicitly provided, yeah? Our constraint on org name uniqueness means some name will need to be set.

ikreymer commented 3 weeks ago

By making org name optional, you mean setting something like "[User name]'s Archive" as a default in the endpoint if a name isn't explicitly provided, yeah? Our constraint on org name uniqueness means some name will need to be set.

Yes, making it optional in the API call that creates the org, allowing to defaults to orgName = orgSlug = orgId

ikreymer commented 2 weeks ago

This was partially implemented in #1897, however more work is needed to further support subscriptions

ikreymer commented 1 week ago

Fixed via #1914!