Parchment Docs

Users

User and profile management

Get Auth Sessions Current

GET
/auth/sessions/current

Response Body

curl -X GET "https://example.com/auth/sessions/current"
fetch("https://example.com/auth/sessions/current")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/auth/sessions/current"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/auth/sessions/current"

response = requests.request("GET", url)

print(response.text)
Empty

Get Users

GET
/users

Response Body

curl -X GET "https://example.com/users/"
fetch("https://example.com/users/")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/users/"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/"

response = requests.request("GET", url)

print(response.text)
Empty

Create a new user

POST
/users

Request Body

application/jsonRequired
firstNameRequiredstring
lastNameRequiredstring
emailRequiredstring
Format: "email"
picturestring
rolestring

Response Body

curl -X POST "https://example.com/users/" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "picture": "string",
    "role": "user"
  }'
const body = JSON.stringify({
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "picture": "string",
  "role": "user"
})

fetch("https://example.com/users/", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://example.com/users/"
  body := strings.NewReader(`{
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "picture": "string",
    "role": "user"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/"
body = {
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "picture": "string",
  "role": "user"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
Empty

Get Users Roles

GET
/users/roles

Response Body

curl -X GET "https://example.com/users/roles"
fetch("https://example.com/users/roles")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/users/roles"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/roles"

response = requests.request("GET", url)

print(response.text)
Empty

Get all permissions

GET
/users/permissions

Response Body

curl -X GET "https://example.com/users/permissions"
fetch("https://example.com/users/permissions")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/users/permissions"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/permissions"

response = requests.request("GET", url)

print(response.text)
Empty

Get Users Me Identity

Get current user federation identity (handle, keys)

GET
/users/me/identity

Response Body

curl -X GET "https://example.com/users/me/identity"
fetch("https://example.com/users/me/identity")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/users/me/identity"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/me/identity"

response = requests.request("GET", url)

print(response.text)
Empty

Patch Users Me Alias

Update current user alias (username for federation)

PATCH
/users/me/alias

Request Body

application/jsonRequired
aliasRequiredstring

Response Body

curl -X PATCH "https://example.com/users/me/alias" \
  -H "Content-Type: application/json" \
  -d '{
    "alias": "string"
  }'
const body = JSON.stringify({
  "alias": "string"
})

fetch("https://example.com/users/me/alias", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://example.com/users/me/alias"
  body := strings.NewReader(`{
    "alias": "string"
  }`)
  req, _ := http.NewRequest("PATCH", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/me/alias"
body = {
  "alias": "string"
}
response = requests.request("PATCH", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
Empty

Put Users Me Keys

Register or update federation public keys

PUT
/users/me/keys

Request Body

application/jsonRequired
signingKeyRequiredstring
encryptionKeyRequiredstring

Response Body

curl -X PUT "https://example.com/users/me/keys" \
  -H "Content-Type: application/json" \
  -d '{
    "signingKey": "string",
    "encryptionKey": "string"
  }'
const body = JSON.stringify({
  "signingKey": "string",
  "encryptionKey": "string"
})

fetch("https://example.com/users/me/keys", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://example.com/users/me/keys"
  body := strings.NewReader(`{
    "signingKey": "string",
    "encryptionKey": "string"
  }`)
  req, _ := http.NewRequest("PUT", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/me/keys"
body = {
  "signingKey": "string",
  "encryptionKey": "string"
}
response = requests.request("PUT", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
Empty

Get Users Me Preferences

Get current user preferences (language, unit system)

GET
/users/me/preferences

Response Body

curl -X GET "https://example.com/users/me/preferences"
fetch("https://example.com/users/me/preferences")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/users/me/preferences"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/me/preferences"

response = requests.request("GET", url)

print(response.text)
Empty

Put Users Me Preferences

Update current user preferences (language, unit system)

PUT
/users/me/preferences

Request Body

application/jsonRequired
languagestring
unitSystemstring

Response Body

curl -X PUT "https://example.com/users/me/preferences" \
  -H "Content-Type: application/json" \
  -d '{
    "language": "string",
    "unitSystem": "metric"
  }'
const body = JSON.stringify({
  "language": "string",
  "unitSystem": "metric"
})

fetch("https://example.com/users/me/preferences", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://example.com/users/me/preferences"
  body := strings.NewReader(`{
    "language": "string",
    "unitSystem": "metric"
  }`)
  req, _ := http.NewRequest("PUT", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/users/me/preferences"
body = {
  "language": "string",
  "unitSystem": "metric"
}
response = requests.request("PUT", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
Empty