> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# UpsertResolvedStep

# Package: onlinePrograms

# Namespace: ResolvedStepsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/upsert-resolved-step.md

## Permission Scopes:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Creates or updates a resolved step.

If a resolved step exists for the specified `participantId` and `programStepId`, the method updates it. Otherwise, the method creates a resolved step. The participant must have joined the program that contains the step.

For quiz steps, specify `quizSubmissionId`. The quiz submission must belong to the quiz associated with the program step. For non-quiz steps, omit `quizSubmissionId`.

---

## REST API

### Schema

```
 Method: upsertResolvedStep
 Description: Creates or updates a resolved step.  If a resolved step exists for the specified `participantId` and `programStepId`, the method updates it. Otherwise, the method creates a resolved step. The participant must have joined the program that contains the step.  For quiz steps, specify `quizSubmissionId`. The quiz submission must belong to the quiz associated with the program step. For non-quiz steps, omit `quizSubmissionId`.
 URL: https://www.wixapis.com/online-programs/participants/v3/resolved-steps/upsert/participant/{resolvedStep.participantId}/step/{resolvedStep.programStepId}
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  resolvedStep, resolvedStep.participantId, resolvedStep.programStepId
 Method parameters: 
   param name: resolvedStep | type: ResolvedStep | description: A resolved step represents a participant's completion or attempt of a program step.  The combination of `participantId` and `programStepId` uniquely identifies a resolved step. Upserting the same combination updates the existing resolved step.  For quiz steps, specify `quizSubmissionId`. The API copies `earnedScore` and `passingGrade` from the quiz submission and sets `status` to `COMPLETED` or `FAILED`.  For non-quiz steps, omit `quizSubmissionId`. The API sets `status` to `COMPLETED`. | required: true 
        - name: participantId | type: string | description: Participant GUID. | required: true | validation: format GUID, immutable
        - name: programStepId | type: string | description: Program step GUID. | required: true | validation: format GUID, immutable
        - name: quizSubmissionId | type: string | description: Quiz submission GUID.  Required for quiz steps. Omit for non-quiz steps.  | validation: format GUID
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the resolved step. [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
 Return type: UpsertResolvedStepResponse
  - name: resolvedStep | type: ResolvedStep | description: Created or updated resolved step.  
     - name: id | type: string | description: Resolved step GUID.  | read-only: true | validation: format GUID
     - name: participantId | type: string | description: Participant GUID.  | validation: format GUID, immutable
     - name: programStepId | type: string | description: Program step GUID.  | validation: format GUID, immutable
     - name: quizSubmissionId | type: string | description: Quiz submission GUID.  Required for quiz steps. Omit for non-quiz steps.  | validation: format GUID
     - name: earnedScore | type: integer | description: Score earned by the participant. Returned only for quiz steps.  | read-only: true | validation: minimum 0, maximum 100, format int32
     - name: passingGrade | type: integer | description: Minimum score required to pass the quiz. Returned only for quiz steps.  | read-only: true | validation: minimum 0, maximum 100, format int32
     - name: status | type: Status | description: Completion status. For quiz steps, the status depends on whether `earnedScore` meets `passingGrade`. For non-quiz steps, the status is `COMPLETED`.  | read-only: true 
         - enum:
         -     COMPLETED: The participant completed the step. For quiz steps, `earnedScore` meets or exceeds `passingGrade`.
         -     FAILED: The participant failed the quiz step because `earnedScore` is below `passingGrade`.
     - name: createdDate | type: string | description: Date and time the resolved step was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the resolved step was updated.  | read-only: true | validation: format date-time
     - name: extendedFields | type: ExtendedFields | description: Custom field data for the resolved step. [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: QUIZ_SUBMISSION_ID_REQUIRED | Description: `quizSubmissionId` is required for quiz steps. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: QUIZ_SUBMISSION_STEP_MISMATCH | Description: The quiz submission doesn't belong to the quiz associated with the specified program step. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: QUIZ_SUBMISSION_NOT_FOUND | Description: Couldn't find the quiz submission. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: STEP_NOT_FOUND | Description: Couldn't find the program step. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PARTICIPANT_NOT_FOUND | Description: Couldn't find the participant. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PARTICIPANT_NOT_JOINED | Description: The participant hasn't joined the program that contains the specified step. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.


```

### Examples

### Mark a non-quiz step as complete
Creates or updates a resolved step for a participant and a non-quiz program step

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/participants/v3/resolved-steps/upsert/participant/242bb87d-b619-4bf1-92dd-2970a574c97c/step/fd538186-d006-4fe6-b8e2-0949ac03b90c' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "resolvedStep": {
    "participantId": "242bb87d-b619-4bf1-92dd-2970a574c97c",
    "programStepId": "fd538186-d006-4fe6-b8e2-0949ac03b90c"
  }
}'
```

### Record a failed quiz attempt
Creates a failed resolved step when the participant's quiz score is below the passing grade

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/participants/v3/resolved-steps/upsert/participant/9d0927dd-d946-4223-b395-ccbc10f5dbde/step/3c79741a-54bb-4c1b-a79f-a5e5e91a9cf5' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "resolvedStep": {
    "participantId": "9d0927dd-d946-4223-b395-ccbc10f5dbde",
    "programStepId": "3c79741a-54bb-4c1b-a79f-a5e5e91a9cf5",
    "quizSubmissionId": "196effdc-3cd8-40e4-ac23-87ed930bcd2e"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.resolvedSteps.upsertResolvedStep(identifiers, resolvedStep)
 Description: Creates or updates a resolved step.  If a resolved step exists for the specified `participantId` and `programStepId`, the method updates it. Otherwise, the method creates a resolved step. The participant must have joined the program that contains the step.  For quiz steps, specify `quizSubmissionId`. The quiz submission must belong to the quiz associated with the program step. For non-quiz steps, omit `quizSubmissionId`.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  resolvedStep, identifiers.resolvedStepParticipantId, identifiers.resolvedStepProgramStepId, identifiers
 Method parameters: 
   param name: identifiers | type: UpsertResolvedStepIdentifiers  none | required: true 
        - name: resolvedStepParticipantId | type: string | description: Participant GUID. | required: true | validation: format GUID, immutable
        - name: resolvedStepProgramStepId | type: string | description: Program step GUID. | required: true | validation: format GUID, immutable
   param name: resolvedStep | type: UpsertResolvedStep | description: A resolved step represents a participant's completion or attempt of a program step.  The combination of `participantId` and `programStepId` uniquely identifies a resolved step. Upserting the same combination updates the existing resolved step.  For quiz steps, specify `quizSubmissionId`. The API copies `earnedScore` and `passingGrade` from the quiz submission and sets `status` to `COMPLETED` or `FAILED`.  For non-quiz steps, omit `quizSubmissionId`. The API sets `status` to `COMPLETED`. | required: true 
        - name: participantId | type: string | description: Participant GUID.  | validation: format GUID, immutable
        - name: programStepId | type: string | description: Program step GUID.  | validation: format GUID, immutable
        - name: quizSubmissionId | type: string | description: Quiz submission GUID.  Required for quiz steps. Omit for non-quiz steps.  | validation: format GUID
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the resolved step. [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
 Return type: PROMISE<UpsertResolvedStepResponse>
  - name: resolvedStep | type: ResolvedStep | description: Created or updated resolved step.  
     - name: _id | type: string | description: Resolved step GUID.  | read-only: true | validation: format GUID
     - name: participantId | type: string | description: Participant GUID.  | validation: format GUID, immutable
     - name: programStepId | type: string | description: Program step GUID.  | validation: format GUID, immutable
     - name: quizSubmissionId | type: string | description: Quiz submission GUID.  Required for quiz steps. Omit for non-quiz steps.  | validation: format GUID
     - name: earnedScore | type: integer | description: Score earned by the participant. Returned only for quiz steps.  | read-only: true | validation: minimum 0, maximum 100, format int32
     - name: passingGrade | type: integer | description: Minimum score required to pass the quiz. Returned only for quiz steps.  | read-only: true | validation: minimum 0, maximum 100, format int32
     - name: status | type: Status | description: Completion status. For quiz steps, the status depends on whether `earnedScore` meets `passingGrade`. For non-quiz steps, the status is `COMPLETED`.  | read-only: true 
         - enum:
         -     COMPLETED: The participant completed the step. For quiz steps, `earnedScore` meets or exceeds `passingGrade`.
         -     FAILED: The participant failed the quiz step because `earnedScore` is below `passingGrade`.
     - name: _createdDate | type: Date | description: Date and time the resolved step was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the resolved step was updated.  | read-only: true 
     - name: extendedFields | type: ExtendedFields | description: Custom field data for the resolved step. [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: QUIZ_SUBMISSION_ID_REQUIRED | Description: `quizSubmissionId` is required for quiz steps. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: QUIZ_SUBMISSION_STEP_MISMATCH | Description: The quiz submission doesn't belong to the quiz associated with the specified program step. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: QUIZ_SUBMISSION_NOT_FOUND | Description: Couldn't find the quiz submission. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: STEP_NOT_FOUND | Description: Couldn't find the program step. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PARTICIPANT_NOT_FOUND | Description: Couldn't find the participant. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PARTICIPANT_NOT_JOINED | Description: The participant hasn't joined the program that contains the specified step. See [Errors](https://dev.wix.com/docs/api-reference/business-management/online-programs/resolved-steps/errors.md) for troubleshooting.


```

### Examples

### Record a failed quiz attempt
```javascript
import { resolvedSteps } from "@wix/online-programs";

async function upsertQuizResolvedStep() {
  const response = await resolvedSteps.upsertResolvedStep(
    {
      resolvedStepParticipantId: "9d0927dd-d946-4223-b395-ccbc10f5dbde",
      resolvedStepProgramStepId: "3c79741a-54bb-4c1b-a79f-a5e5e91a9cf5",
    },
    {
      quizSubmissionId: "196effdc-3cd8-40e4-ac23-87ed930bcd2e",
    },
  );
}

/* Promise resolves to:
 * {
 *   "resolvedStep": {
 *     "_id": "2853ffcb-da06-4d0d-a65d-7e6aaf7ec290",
 *     "participantId": "9d0927dd-d946-4223-b395-ccbc10f5dbde",
 *     "programStepId": "3c79741a-54bb-4c1b-a79f-a5e5e91a9cf5",
 *     "quizSubmissionId": "196effdc-3cd8-40e4-ac23-87ed930bcd2e",
 *     "earnedScore": 28,
 *     "passingGrade": 60,
 *     "status": "FAILED",
 *     "_createdDate": "2026-09-15T15:23:05.485Z",
 *     "_updatedDate": "2026-09-15T15:23:05.485Z"
 *   }
 * }
 */

```

### Mark a non-quiz step as complete
```javascript
import { resolvedSteps } from "@wix/online-programs";

async function upsertResolvedStep() {
  const response = await resolvedSteps.upsertResolvedStep(
    {
      resolvedStepParticipantId: "242bb87d-b619-4bf1-92dd-2970a574c97c",
      resolvedStepProgramStepId: "fd538186-d006-4fe6-b8e2-0949ac03b90c",
    },
    {},
  );
}

/* Promise resolves to:
 * {
 *   "resolvedStep": {
 *     "_id": "fd91c2d0-a4f8-4552-8950-cb36fb1ae419",
 *     "participantId": "242bb87d-b619-4bf1-92dd-2970a574c97c",
 *     "programStepId": "fd538186-d006-4fe6-b8e2-0949ac03b90c",
 *     "status": "COMPLETED",
 *     "_createdDate": "2026-09-15T13:32:19.044Z",
 *     "_updatedDate": "2026-09-15T13:32:19.044Z"
 *   }
 * }
 */

```

### upsertResolvedStep (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { resolvedSteps } from '@wix/online-programs';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { resolvedSteps },
  // Include the auth strategy and host as relevant
});


async function upsertResolvedStep(identifiers,resolvedStep) {
  const response = await myWixClient.resolvedSteps.upsertResolvedStep(identifiers,resolvedStep);
};
```

---