Any user associated with a context with AUTHENTICATED scope can execute createPost mutation. The current API user will be set as an author. A content such as a learning path or a certificate can be shared. If the provided content doesn’t relate to the current API user, it will be skipped, and a post will be created only with the text. Mutation has a single required incoming argument - data that represents PostCreationInput object:
ParameterTypeDescription
textStringRequired. The post body text. Available HTML tags are: <a>, <p>, <br>. Any other tag will be trimmed.
sharedContentPostSharedContentInputOptional. Contains the data related to the content that is going to be shared in the post (learning path or a certificate). See the table below for more information.
PostSharedContentInput
ParameterTypeDescription
contentIdIDRequired. ID of the shared content (a learning path or a certificate).
contentTypePostSharedContentTypeRequired. Contains the type of the shared content. Available options: LEARNING_PATH or CERTIFICATE.
The list of certificates available for sharing can be retrieved by calling getPaginatedUserCertificates query. To get the list of learning paths (trainings) available for sharing, the getTrainingsForSharing query should be called.
  mutation createPost {
    createPost(data: {
      text: "This is a dummy post text",
      sharedContent: {
        contentId: 69,
        contentType: LEARNING_PATH
      }
    }) {
      response {
        id
        text
        created
        authorUserContext {
          id
          uuid
        }
        sharedContent {
        id
        type
        title
        description
        earnedOn
          image {
            alt
            title
            url
          }
        }
        cta {
          actionId
          title
          arguments {
            key
            value
          }
        }
      }
      errors
    }
  }
The mutation returns a Post object. Detailed description and the full list of available properties can be found here.