SocialProfiles

Profiles

Profiles related to Social

These endpoints allow you to manage profiles. They are the users of the social network and are the owners of posts.

These endpoints support pagination and sorting. Read more about these features here.

The Profile model

PropTypeDefault
name
string
-
email
string
-
bio
string
-
banner
object
-
avatar
object
-
_count
object
-

Query parameters

Not all of the properties of a post are returned by default. You can use the following optional query parameters to include additional properties in the response.

PropTypeDefault
_following
boolean
false
_followers
boolean
false
_posts
boolean
false
Example with all optional query parameters
{
  "data": {
    "name": "string",
    "email": "user@example.com",
    "bio": "string",
    "banner": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "avatar": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "followers": [
      {
        "name": "string",
        "email": "user@example.com",
        "bio": "string",
        "avatar": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        },
        "banner": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        }
      }
    ],
    "following": [
      {
        "name": "string",
        "email": "user@example.com",
        "bio": "string",
        "avatar": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        },
        "banner": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        }
      }
    ],
    "posts": [
      {
        "id": 0,
        "owner": "string",
        "title": "string",
        "body": "string",
        "tags": ["string"],
        "media": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        },
        "created": "2022-09-04T08:08:38.830Z",
        "updated": "2022-09-04T08:08:38.830Z"
      }
    ],
    "_count": {
      "posts": 0,
      "followers": 0,
      "following": 0
    }
  },
  "meta": {}
}

All profiles

GET/social/profiles

Retrieve all profiles.

Response
{
  "data": [
    {
      "name": "string",
      "email": "user@example.com",
      "bio": "string",
      "banner": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "avatar": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "_count": {
        "posts": 0,
        "followers": 0,
        "following": 0
      }
    },
    {
      "name": "string",
      "email": "user@example.com",
      "bio": "string",
      "banner": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "avatar": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "_count": {
        "posts": 0,
        "followers": 0,
        "following": 0
      }
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Single profile

GET/social/profiles/<name>

Retrieve a single profile by its id.

Response
{
  "data": {
    "name": "string",
    "email": "user@example.com",
    "bio": "string",
    "banner": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "avatar": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "_count": {
      "posts": 0,
      "followers": 0,
      "following": 0
    }
  },
  "meta": {}
}

All posts by profile

GET/social/profiles/<name>/posts

Retrieve all posts made by profile.

The response is the same as the posts endpoint, and accepts the same optional query parameters and flags.

Response
{
  "data": [
    {
      "id": 0,
      "title": "string",
      "body": "string",
      "tags": ["string"],
      "media": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "created": "2022-09-04T08:08:38.830Z",
      "updated": "2022-09-04T08:08:38.830Z",
      "_count": {
        "comments": 0,
        "reactions": 0
      }
    },
    {
      "id": 0,
      "title": "string",
      "body": "string",
      "tags": ["string"],
      "media": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "created": "2022-09-04T08:08:38.830Z",
      "updated": "2022-09-04T08:08:38.830Z",
      "_count": {
        "comments": 0,
        "reactions": 0
      }
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Update profile

PUT/social/profiles/<name>

Update or set bio, banner and avatar properties.

You may provide any combination of the properties, but at least one must be provided.

Please note that the avatar.url and banner.url properties must be fully formed URLs that links to live and publicly accessible images. The API will check the provided URLs and if they cannot be accessed publicly you will receive a 400 Bad Request error response.

Request
{
  "bio": "string",
  "banner": {
    "url": "https://url.com/image.jpg",
    "alt": "string"
  },
  "avatar": {
    "url": "https://url.com/image.jpg",
    "alt": "string"
  }
}
Response
{
  "data": {
    "name": "string",
    "email": "user@example.com",
    "bio": "string",
    "banner": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "avatar": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    }
  },
  "meta": {}
}

Follow & Unfollow profile

PUT/social/profiles/<name>/follow
PUT/social/profiles/<name>/unfollow

Follow or unfollow another profile by its name.

The request body should be empty.

Response
{
  "data": {
    "followers": [
      {
        "name": "string",
        "email": "user@example.com",
        "bio": "string",
        "banner": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        },
        "avatar": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        }
      }
    ],
    "following": [
      {
        "name": "string",
        "email": "user@example.com",
        "bio": "string",
        "banner": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        },
        "avatar": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        }
      }
    ]
  },
  "meta": {}
}

Search profiles

GET/social/profiles/search?q=<query>

Search for profiles by their name or bio properties.